Telegram Bot gets “Bad Request: message text is empty”

telegram-bot

When my Telegram bot sends sendMessage to Telegram server it gets the error message:

{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}

The problem appeared this morning, before that my bot worked a whole year without errors. GetUpdates command works well as before. I use GET HTTP method to send commads:

https://api.telegram.org/bot<MyToken>/sendMessage

with UTF-8-encoded data attached:

{"chat_id":123456789,"text":"any text"}

Has anyone encountered this?

Best Answer

If the issue still persists, try to modify your curl request. For me adding header 'Content-Type: application/json' and -d '{"chat_id":12309832,"text":"any text"}' fixed issue

Related Topic