S
S
sound9012018-01-31 11:56:35
Python
sound901, 2018-01-31 11:56:35

How to split @bot.callback_query_handler into 2 different handlers?

How to split @bot.callback_query_handler into 2 handlers?
So that each handler works with its own set of inline buttons.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
ghostku, 2018-07-04
@ghostku

I understand that the question is probably no longer relevant, but I do this:

@bot.callback_query_handler(func=lambda call: call.data == 'Мой_КоллБэк_Статус')

X
xdgadd, 2018-01-31
@xdgadd

Use the option callback_data . After that, you will be able to access it using the attribute data:

...
if call.data == "trigger_1":
    do_thing_1()
elif call.data == ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question