Answer the question
In order to leave comments, you need to log in
What is the error of the bot on PyTelegramBotAPI?
I have a function that receives a forwarded message from a channel and then sends it out. The bot is in the channel admins, everything is OK, everything is fine, but there is one mistake:
2020-08-06 23:16:19,474 (__init__.py:455 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: message to forward not found"}']"
def send_message_users(message):
with open(chat_ids_file, "r") as ids_file:
ids_list = [line.split('\n')[0] for line in ids_file]
bot.send_message(message.chat.id, 'Рассылка начата, ожидайте вам прийдет отчет.')
no = 0
for chat_id in ids_list:
try:
bot.forward_message(chat_id, message.forward_from_chat.id, message.message_id)
except:
no += 1
bot.send_message(message.chat.id, f'Рассылка успешно закончена! Недошло - {no}')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question