Answer the question
In order to leave comments, you need to log in
Development of TelegramBot in Python. Is it possible to add a property to the callback_query_handler handler so that it can handle more than 1 inlineBaton?
Now @bot.callback_query_handler(lambda first: first.data == "magnit") only handles "magnit", how can I make it handle all inlines?
@bot.callback_query_handler(lambda first: first.data == "magnit")
def callback_inline(call):
try:
if call.message:
if call.data == 'magnit':
bot.send_message(call.message.chat.id, 'Выберите подкатегорию.')
elif call.data == 'mac':
bot.send_message(call.message.chat.id, 'Выберите подкатегорию.')
elif call.data == 'kfc':
bot.send_message(call.message.chat.id, 'Выберите подкатегорию.')
except Exception as e:
print(e)
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