Relative Content

Tag Archive for pythontelegramtelegram-botpy-telegram-bot-api

telebot.Bot.send_message Error code: 400. Description: Bad Request: SEND_AS_PEER_INVALID

My program does sends messages to Telegram using pytelegrambotapi constantly, usually 2-4 times a minute, to the same group. It worked for a couple dozens of hours but then the usual call of the telebot.Bot.send_message raised telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: SEND_AS_PEER_INVALID. In the tg bot docs we can read about this error: You can't send messages as the specified peer.

How to use thumbnail parameter in send_document pytelegrambotapi

I am not a coder, but i managed to create a telegram bot in python and it’s working well, except the thumbnail parameter, the bot ask user to send an image to set as thumbnail for the document, then the bot send the document back to user with thumbnail image preview but it didn’t change.
Here is my script: