specified new message content and reply markup
Hi, i have
if call.data == 'pn'':
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.pn, reply_markup=gen_markup())
elif call.data == 'vt':
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.vt, reply_markup=gen_markup())
elif call.data == 'sr'':
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.sr, reply_markup=gen_markup())
At first everything works well, but if I click on the menu items many times it gives me this error
Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message
The text in the vars is different
try without if elif, it helped me: @bot.callback_query_handler(func=lambda call: call.data == 'pn') def pn(call): bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.pn, reply_markup=gen_markup())
@bot.callback_query_handler(func=lambda call: call.data == 'vt') def vt(call): bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.vt, reply_markup=gen_markup())
@bot.callback_query_handler(func=lambda call: call.data == 'sr') def srn(call): bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=con.tittle + con.sr, reply_markup=gen_markup())