在几个小时内,当我尝试向我的机器人是管理员的频道发送消息时,我遇到了问题。它工作了好几个星期,但我发现它现在给了我一个错误。
import telegram
import asyncio
token = 'your_token'
async def bot_send_message(msg, chat_id):
bot = telegram.Bot(token)
token = token
async with bot:
await bot.send_message(text=msg, chat_id=chat_id)
chat_id = 'your_chat_id'
asyncio.run(bot_send_message('msg', chat_id=chat_id))
错误是:
telegram.error.BadRequest: Not enough rights to send text messages to the chat
我的机器人是频道的管理员。之前还好好的。
你并不孤单! 我发现与陷入这个问题的人们进行了某种聊天https://github.com/telegraf/telegraf/discussions/1833
问题于 UTC 时间 01:30 左右开始,实际上仅适用于向频道发送消息的机器人