12

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()));

and

        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 ....

3 Answers 3

17

According to Bots FAQ

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Do you know if it's possible to send a message to another bot directly?
7

You can connect 2 (or more) bots with a private channel!

Just prompt the bots as admin in the channel.

Then when a bot send a post to the channel, other admin bots can see the message/file/...

2 Comments

OP wrote: When adding both bots to a group as administrators. I still cannot receive the message with my second bot
@NikolaiShevchenko i say "channel" not "group"
-1

Bot wouldn't be able to send message to other bots. in most platform APIs it return an error. kindly go through the documentation for the client(bot) and see its functionalities

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.