message from users, when they click keyboard (one click) and therefore bot send a duplicate answers to users. How can I solve this problem?
def send_keyboard(message, text = "Choose your interest 😉"): keyboard = types.ReplyKeyboardMarkup(row_width=2) itembtn0 = types.KeyboardButton('Walking’) itembtn1 = types.KeyboardButton(‘Running’) keyboard.add(itembtn0, itembtn1) msg = bot.send_message(message.from_user.id,text=text, reply_markup=keyboard) bot.register_next_step_handler(msg, callback_worker) def callback_worker(call): if call.text == “Walking”: print(call.text) # Here I see duplicate income messages msg = bot.send_message(call.chat.id, ''Great!’’) bot.register_next_step_handler(msg, walking)
No, I don't know about getupdates method and don't using a webhook( Is it great for this problem?
Thx!😉 Wrote in PM
Обсуждают сегодня