简体   繁体   English

电报,从机器人到机器人的短信

[英]Telegram, Texting From Bot to Bot

Is it possible to send message from a Telegram Bot to another Telegram Bot?是否可以从 Telegram Bot 向另一个 Telegram Bot 发送消息?

I got an error response when sending text to another bot either using @botname or directly botname as target id.使用@botname 或直接将botname 作为目标ID 向另一个机器人发送文本时,我收到了错误响应。

I'm sending a request by hitting url like this form api.telegram.org/mybottoken/… Im using .net to perform the operation.我正在通过像这样的表单api.telegram.org/mybottoken/…这样点击 url 来发送请求api.telegram.org/mybottoken/…我使用 .net 来执行操作。

The response is :回应是:

System.Net.WebException: The remote server returned an error: (400) Bad Request. System.Net.WebException:远程服务器返回错误:(400) 错误请求。 at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) Sending text to human user is fine with the code, but not with the Bot.在 System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) 向人类用户发送文本对代码很好,但对 Bot 无效。

I found this as the answer to my question.我发现这是我的问题的答案。

@nick Lee : No, it is not possible. @nick Lee :不,这是不可能的。 A bot can only send messages to someone who has sent it messages.机器人只能向向其发送消息的人发送消息。 That means a bot can only talk to a human, but not another bot这意味着机器人只能与人类交谈,而不能与其他机器人交谈

From the documentation:从文档:

Why doesn't my bot see messages from other bots? 为什么我的机器人看不到来自其他机器人的消息?

Bots talking to each other could potentially get stuck in unwelcome loops.机器人相互交谈可能会陷入不受欢迎的循环。 To avoid this, we decided that bots will not be able to see messages from other bots regardless of mode.为避免这种情况,我们决定无论模式如何,机器人都将无法看到来自其他机器人的消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM