Hi! Can u help me, my telegram bot getting duplicate

message from users, when they click keyboard (one click) and therefore bot send a duplicate answers to users. How can I solve this problem?

3 ответов

40 просмотров
Владимир-Петров Автор вопроса

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

Похожие вопросы

Карта сайта