Skip to main content

Library for creating chatbots

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pychatbotlib-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

pychatbotlib-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pychatbotlib-1.0.1.tar.gz.

File metadata

  • Download URL: pychatbotlib-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pychatbotlib-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2de611fb7a1adfadeb26608a1182b5f0d34cd3a71d00914f0dc9098961ebcc41
MD5 df26960dbe46b3c7b0124a206cd56895
BLAKE2b-256 88521f5a288aafb1cc6cc0bf89bb345f062cf075186b7bdbc34313c9507df4b0

See more details on using hashes here.

File details

Details for the file pychatbotlib-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pychatbotlib-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pychatbotlib-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b532801d7b2b2567f440d71231daf19aabcd7366e1794349e714c3af5b16ecd7
MD5 5ee7b61d65217ffe86f27ab85aab04f1
BLAKE2b-256 592faf73fc6606eea2f1c53a83fef0d24450b955ec0b4784ea2c547147145bbd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page