smart conversation bots package
Project description
pythonSmartBots
smart conversation bots package
Free software: MIT license
Documentation: https://smartbotsol.readthedocs.io.
Getting started
Describe yor states
Create server.py:
from telegram.ext import Updater from smartbotsol import StateMachine from smartbotsol.telegram import FsmTelegramHandler import logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG) log = logging.getLogger(__name__) from states import BootStrapState handler = FsmTelegramHandler( StateMachine( BootStrapState(), filters=[] ) ) def create_bot(): token = os.environ.get('TELEGRAM_TOKEN') port = int(os.environ.get('PORT', '5000')) updater = Updater(token) updater.dispatcher.add_handler(handler) return updater def start_polling_bot(): bot = create_bot() bot.start_polling(read_latency=50.0) return bot if __name__ == '__main__': start_polling_bot()
For async runs pass async=True:
handler = FsmTelegramHandler( StateMachine( BootStrapState(), filters=[] ), async=True )
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
1.0.0 (2017-08-17)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smartbotsol-1.0.0.tar.gz
(18.3 kB
view hashes)
Built Distribution
Close
Hashes for smartbotsol-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eaba22824ae0bd59b588fc4e31199cdd099829e8d09f7117146185368303522 |
|
MD5 | addb45a8d9df10efbf9d185ae3e1be03 |
|
BLAKE2b-256 | bdeb04101e089f51e51b26bf371e5dfdcb55d54d1b1046ce94cce95dbd8d3e5b |