M
M
mhkodas2021-11-10 09:12:51
Bots
mhkodas, 2021-11-10 09:12:51

ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: message to delete not found"?

I created an Auto poster bot, but this error is sent, what should I do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jerwright, 2021-11-10
@mhkodas

Either one of the chat participants, or you have previously deleted this message. Add the following construct for such cases:

try:
    bot.delete_message(chat_id='id чата', message_id='id сообщения')
except Exception as ex:
    print(ex)

Add just the chat and message id and the error won't prevent the code from executing

P
Python Newbie, 2021-11-10
@Levman5

message to delete not found

Translation: message to delete not found

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question