V
V
Viplayer2021-11-21 20:41:51
Python
Viplayer, 2021-11-21 20:41:51

How to handle inline button by bot if callback_data is unknown?

The aiogram library is used for the bot:

I send an inline button, where callback_data is "user:{user_id}"
And the command is processed in this way

@dp.callback_query_handler(text="user:")

Therefore, the handler ignores the command if callback_data != "user:"
But I somehow need to receive data from the button

Tell me how to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-21
@Viplayer

It is logical that you need to use a different filter

@dp.callback_query_handler(lambda callback_query: True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question