I am writing a bot in Telegram in Python . I work with the pyTelegramBotAPI library.
Given: quest bot. For each task you can get a hint from it by pressing either the / hint command or the "Hint" button.
Task: answer with different hints for different tasks.
What wrote:
@bot.message_handler(commands=['start']) def handle_text(message): user_markup = telebot.types.ReplyKeyboardMarkup(1) user_markup.row("A", "B") bot.send_message(message.from_user.id, constants.start, reply_markup=user_markup) @bot.message_handler(content_types=['text']) def handle_text(message): if message.text == "A": bot.send_message(message.from_user.id, "Task 1, /hint") elif message.text == "/hint": bot.send_message(message.from_user.id, "Hint 1") @bot.message_handler(content_types=['text']) def handle_text(message): if message.text == "B": bot.send_message(message.from_user.id, "Task 2, /hint") elif message.text == "/hint": bot.send_message(message.from_user.id, "Hint 2") Of course, this code does not go, set it as an example, so that it is clear what Iβm trying to achieve.
The bot does not respond to the second command:

handle_textfunction must be one. In it is a search of possible messages: `if message == 'A': ... elif message == 'B': ...`. - Lebedev Ilya