电报机器人向机器人发送消息 [英] Telegram Bot send Message to bot

查看:448
本文介绍了电报机器人向机器人发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个电报机器人。发送到组或用户时,这很好用。但是我有一个特殊的要求。我需要能够发送给另一个机器人。将两个机器人作为管理员添加到组中时。我的第二个机器人仍然无法收到该消息。我只能使用我的真实用户帐户看到它,该帐户已添加到该组中。
我想念什么?
我使用OKHttp发送消息

I have programmed a telegram bot. This works fine when sending to groups or to users. However I do a special requirement. I need to be able to send to another bot. When adding both bots to a group as administrators. I still cannot receive the message with my second bot. I only see it with my real user account, that is added to this group. What am I missing? I used OKHttp to send the message

            Request request = new Request.Builder()
                .url("https://api.telegram.org/bot"+telSetup.getToken()+"/sendMessage?chat_id="+lAdr+"&parse_mode=HTML&text="+strMessage)
                .build();
            client.newCall(request).enqueue(new MyIPProcessing(request.toString()));

        if (response.message().equals("OK")){
            List <String> lStr=response.request().url().encodedPathSegments(); 

...

...基本上可以与真实用户进行交流。

to receive messages ... which basically works for communication with "real users".

任何想法都欢迎...。

Any ideas welcome ....

推荐答案

根据< a href = https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots rel = noreferrer>机器人常见问题解答


机器人互相交谈可能会陷入不受欢迎的循环中。

为了避免这种情况,我们决定使用机器人不管使用哪种模式,都将无法看到来自其他漫游器的消息。

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.

这篇关于电报机器人向机器人发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆