N
N
NOblo2020-06-21 20:46:21
Python
NOblo, 2020-06-21 20:46:21

Telegram bot api error, how to solve?

This thing should change already sent messages:

bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text="text")

But it does not change, but displays the following error:
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: 
[b'{"ok":false,"error_code":400,"description":"Bad Request: there is no text in the message to edit"}'] 
" 
2020-06-21 20:32:31,444 (__init__.py:443 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: 
[b'{"ok":false,"error_code":400,"description":"Bad Request: there is no text in the message to edit"}']"


Such things that change the Message in the bot 2 shuks, they work fine. And the third error gives, out of the blue, which, in my opinion, comes out when there are problems with the Internet .... And here is a completely different case

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-06-21
@SoreMix

You don't have text in the message, it's written

N
Nikita Verkhoglyad, 2020-06-22
@Cyclops

A similar error can occur when you change the text to exactly the same text.
That is, the text "hello cuckoo", you are trying to change to "hello cuckoo".
(PS if anything, telegram cuts off spaces and new lines at the beginning and at the end of the message)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question