用Python-Telegram-bot发布超组消息

发布于 2025-02-13 18:25:11 字数 367 浏览 1 评论 0原文

我一直在使用下面的代码向聊天发送电报消息。它运行良好,但该小组已升级到“超级组”,并且已经停止工作了。它只是给出了“找不到聊天”错误。

我有新的ID,并找到了一个建议,我需要将机器人添加为该组的管理员。这些都没有解决问题。

有人知道问题是什么吗?

bot = telegram.Bot(token='xxxxxxxxxxxxxxxxxxxxxxxxxxx')

def post(message):
    msg = dedent(f'''\
        On subject {subject}: {message}
        ''')
    bot.send_message('-1111111111', text=msg)

I have been sending Telegram messages to a chat using the code below. It worked fine but the group has been upgraded to a "Supergoup" and it has stopped working. It just gives a "Chat cannot be found" error.

I have the new ID and found a suggestion that I needed to add the bot as admin for the group. Neither of these has fixed the problem.

Does anyone know what the issue is?

bot = telegram.Bot(token='xxxxxxxxxxxxxxxxxxxxxxxxxxx')

def post(message):
    msg = dedent(f'''\
        On subject {subject}: {message}
        ''')
    bot.send_message('-1111111111', text=msg)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文