Work in progress
- Python 3.6 or higher
pip install baymax
from baymax.bot import Bot
bot = Bot('token')
@bot.on('/start')
async def start_handler(message):
await bot.reply(message, 'Welcome!')
bot.run()
@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.
from baymax.markups import KeyboardButton, ReplyKeyboardMarkup
@bot.on('/rate')
async def rate_handler(message):
await bot.reply(message, 'Rate me', reply_markup=ReplyKeyboardMarkup(
[
[
KeyboardButton('⭐️'),
KeyboardButton('⭐️⭐️'),
KeyboardButton('⭐️⭐️⭐️')
]
], resize_keyboard=True, one_time_keyboard=True))
NOTE: Reply markup API / objects will be changing, they are far from good now.