Skip to main content

PyChatbotLib


Exclusive library for creating chatbots.
It uses a very simple neural network which helps to recognize possible answers to messages.
You just need to train it in chats with 2 types of messages: reply and original.

Installation

pip install pychatbotlib

Example of usage

import telebot # pip3 install PyTelegramBotAPI==2.2.3
from time import sleep
from chatbot import Chatbot
bot = telebot.TeleBot('APIKEY')
chatbot = Chatbot("chatbot_data")

@bot.message_handler(content_types=["text"])
def handle_message(message):
    try:
        chatbot.add_data(message.text, message.reply_to_message.text)
        answer = chatbot.get_reply(message.text)
        if answer is not None:
            bot.reply_to(message, answer)
    except Exception as e:
        answer = chatbot.get_reply(message.text)
        if answer is not None:
            bot.reply_to(message, answer)
        print("Not a reply")

while True:
    try:
        bot.polling(none_stop=True)
    except Exception as e:
        bot.polling(none_stop=True)

Metadata

Release files for pychatbotlib 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pychatbotlib 1.0.1
File Size Uploaded
pychatbotlib-1.0.1.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pychatbotlib 1.0.1
File Interpreter ABI Platform
pychatbotlib-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 kB

Release files / pychatbotlib-1.0.1.tar.gz

Download URL pychatbotlib-1.0.1.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2de611fb7a1adfadeb26608a1182b5f0d34cd3a71d00914f0dc9098961ebcc41
BLAKE2b-256 checksum
How to use checksums
88521f5a288aafb1cc6cc0bf89bb345f062cf075186b7bdbc34313c9507df4b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.0

Release files / pychatbotlib-1.0.1-py3-none-any.whl

Download URL pychatbotlib-1.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b532801d7b2b2567f440d71231daf19aabcd7366e1794349e714c3af5b16ecd7
BLAKE2b-256 checksum
How to use checksums
592faf73fc6606eea2f1c53a83fef0d24450b955ec0b4784ea2c547147145bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page