A simple telegram bot framework on top of Python asyncio
Project description
Baymax, a simple telegram bot framework on top of Python asyncio
Work in progress
Requirements
- Python 3.7 or higher
Installation
pip install baymax
Basic usage example
from baymax.bot import Bot bot = Bot('token') @bot.on('/start') async def start_handler(message): await bot.reply(message, 'Welcome!') bot.run()
Middleware example
@bot.middleware async def message_logging_middleware(raw_update): bot.logger.info('New update received: %s', raw_update['update_id'])
NOTE: All middleware functions should be coroutines for now, even if they do not have asynchronous actions.
Running tests
git clone git@github.com:dmrz/baymax.git pip install -e . pip install -r requirements-test.txt pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Built Distribution
baymax-0.0.5-py3-none-any.whl
(9.7 kB
view hashes)