Answer the question
In order to leave comments, you need to log in
How to handle inline keyboard inside state aiogram?
I want to process an inline keyboard, with a button to exit the current state to the main menu.
I usually use this syntax
@dp.callback_query_handler()
async def имя(callback_query: types.CallbackQuery):
async def имя(message: types.Message, state: FSMContext):
...
dp.register_message_handler(имя, state=состояние)
async def cancel(callback_query: types.CallbackQuery):
...
dp.register_callback_query_handler(cancel)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question