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-11-02)
First release on PyPI.
1.0.1 (2017-11-05)
Bugfix with reply_markup
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smartbotsol-1.0.1.tar.gz.
File metadata
- Download URL: smartbotsol-1.0.1.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b0607623b0f9ca93fa030fb99b60fbe6641cbf2db0fe11390508d40306cd46f
|
|
| MD5 |
3641dfc40e0bdf6e01d3dd64b73abd5f
|
|
| BLAKE2b-256 |
e8a63a5dfab89c56eda3555acb041df06086305ab695cb0c65fdad02ca90af25
|
File details
Details for the file smartbotsol-1.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: smartbotsol-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f9a0f388fe88e0e6457e25975ef91f9643ac05b6c2cadac5b171e24e99d5c6
|
|
| MD5 |
e8a48878ccfef92d834175c934c1efda
|
|
| BLAKE2b-256 |
1545d0044a8735304ade220070715e96d8cd08550342b70b860c59c9f232dabd
|