【问题标题】:Telegram: Send message to bot from different script电报:从不同的脚本向机器人发送消息
【发布时间】:2020-02-05 01:56:10
【问题描述】:

我有一个电报机器人,它处理用户输入以对发送的链接执行操作。

在我的 Telegram Bot 中,我有:

def handle_message(bot, update):
    url = update.message.text
    # do parsing and add url to database

dispatcher.add_handler(MessageHandler(filters=Filters.text, callback=handle_message))

但是,我还希望能够通过 POST 请求向机器人发送 URL。即使用电报机器人的 API 向自身发送消息,以便它可以解析链接。

如何向我的电报机器人发送 POST 请求并让它在输入端运行 handle_message()

【问题讨论】:

    标签: python python-3.x telegram telegram-bot


    【解决方案1】:

    从技术上讲,impossible 机器人可以相互通信(因此也可以与它们自己通信)。

    【讨论】:

    • 机器人可以在频道中看到其他机器人的消息。
    猜你喜欢
    • 2017-03-19
    • 2017-05-11
    • 2020-08-25
    • 2022-01-27
    • 1970-01-01
    • 2017-09-01
    • 2020-08-25
    • 2021-01-01
    • 2016-05-03
    相关资源
    最近更新 更多