Telegram 机器人在消息后发送错误 "Something went wrong, please try again"

Telegram bot sending error "Something went wrong, please try again" after message

输出

aaaaaa
Something went wrong, please try again.

代码:

import telegram

    TOKEN = "xxxxxxxxxxxxxY"
        bot = telegram.Bot(TOKEN)
        print("Bot connected!")
        chat_id = "@News"

        texto = 'aaaaaa'
        bot.send_message(chat_id, texto, parse_mode='markdown', disable_web_page_preview=True)

requirements.txt python-电报机器人

我该如何解决这个问题?

我遇到了同样的问题。然后我通过BotFather撤销了我的bot token,到现在已经恢复正常了。

我猜有人从 public 存储库中抓取了您的机器人令牌并试图窃取您的机器人。请不要将您的机器人令牌保存在 public 存储库中!

解决方案:撤销您的令牌,不要将其保存在 public 存储库中。