FRIKIdelTO

Error code: 400. Description: Bad Request: message can't be edited

Aug 24th, 2022
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import telebot
  3. from telebot.types import ReplyKeyboardRemove
  4. import time
  5.  
  6. TELEGRAM_TOKEN = <token>
  7. bot = telebot.TeleBot(TELEGRAM_TOKEN)
  8.  
  9. @bot.message_handler(commands=["start"])
  10. def cmd_start(m):
  11.     msg = bot.send_message(m.chat.id, "test", reply_markup=ReplyKeyboardRemove())
  12.     time.sleep(2)
  13.     bot.edit_message_text(text="message edited", chat_id=msg.chat.id, message_id=msg.message_id)
  14.  
  15.  
  16. if __name__ == '__main__':
  17.     bot.infinity_polling()
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment