J
J
Jjran2021-08-31 23:10:10
Bots
Jjran, 2021-08-31 23:10:10

How to reset register_next_step_handler in a bot?

There is such a code, but the problem is that when you press the "Back" button, waiting for the register_next_step_handler response is not reset. How can reset be implemented?

@bot.callback_query_handler(func=lambda call: True)
def callback_worker(call):
    keyboard = types.InlineKeyboardMarkup()
    keyboard.add(types.InlineKeyboardButton(text='<<Назад', callback_data='goadminmenu'))
    mes = bot.edit_message_text(chat_id=call.message.chat.id,message_id=call.message.message_id,
                               text="Введите имя пользователя для поиска. ", reply_markup=keyboard)
    bot.register_next_step_handler(mes, show_logs_from_bd)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question