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.
I want to prevent this error somehow but dont know how. Is this related to anti-spam, rate limiting or something like this?