Ошибка:
(__init__.py:489 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: message can't be edited"
Код:
@bot.message_handler(commands=['show_buttons'])
def sb(message):
cid = message.chat.id
keyb = types.ReplyKeyboardMarkup(resize_keyboard = True)
b1 = types.KeyboardButton('Привет!')
b2 = types.KeyboardButton('Сколько у меня подписчиков?')
keyb.add(b1, b2)
bot.send_message(chat_id = cid, text = 'Процесс показания кнопок: 0%', reply_markup = None)
for i in range(0,101,int(12.5)):
sleep(0.20)
if i == 100:
bot.edit_message_text(chat_id = cid, message_id = 1, text = 'Кнопки успешно показаны', reply_markup = keyb)
else:
bot.edit_message_text(chat_id = cid, message_id = 1, text = 'Процесс показания кнопок:', str(i) + '%', reply_markup = None)