I got a 400 error while sending a request from python to telegram.
Here is the code:
bot_message = message
bot_token = 'xxx'
bot_chatID = 'xxx'
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message
response = requests.get(send_text)
Here's the message that caused error :
sharashahira 2021-01-25 10:37:50 @CIMB_Assists Mana ni kata sampai pkul 4;45pm. Sampai sekaranf error. Boikot cimb clicks app😒
It got "emote" , so I got 400 when send to telegram.
This is the error
{"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 17"}
requests.post()
notrequests.get()
. There is also a python wrapper for bots that might be useful. – Holarctic