python-telegram-bot/handlers/callback_handlers.py

14 lines
699 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from aiogram import types, Dispatcher
from bot_lib.settings import BTN_LIST
from bot_lib.bot_create import logger, some_cb
async def callback_btn_actions(callback_query: types.CallbackQuery, callback_data: dict):
logger.info(f'Callback data: {callback_data}')
await callback_query.message.answer(f'Ну что ж, это был твой выбор... Теперь садись на бутылку {callback_data["action"]}... <i>Пидор</i>')
def register_callback_handlers(dp: Dispatcher):
# Place your handlers here
actions = BTN_LIST['buttons'].keys() | BTN_LIST['buttons'].keys()
dp.register_callback_query_handler(callback_btn_actions, some_cb.filter(action=actions))