Answer the question
In order to leave comments, you need to log in
How to make transition from def back(call): to search(message)?
There is a telegram bot with Inline buttons, I need to be redirected to def search(message) after pressing the button:
@bot.message_handler(content_types=['text'])
def echo_all(message):
pass
def search(message):
print("молодец")
#СЮДА НУЖНО ПЕРЕЙТИ ИЗ call.data == '16-20'
@bot.callback_query_handler(func=lambda call: True)
def callback_query(call):
elif call.data == "search":
bot.delete_message(call.message.chat.id, call.message.message_id)
kb = InlineKeyboardMarkup(row_width = 1)
kb.add(InlineKeyboardButton("16-20", callback_data="16-20"))
kb.add(InlineKeyboardButton("21-25", callback_data="21-25"))
kb.add(InlineKeyboardButton("26-30", callback_data="26-30"))
kb.add(InlineKeyboardButton("30 +", callback_data="30 +"))
bot.send_message(id, "Выберите возрастную категорию:",reply_markup = kb)
elif call.data == '16-20':
#ТУТ НУЖНО ПЕРЕЙТИ НА def search(message)
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