Telegram Groups and Bots

I think the answer to this is no, bots can not post to other bots directly, but thought it was worth asking if there is anyway to do this indirectly like through a group chat?

I tried to setup a group in Telegram with one user account and two bots. The bots are linked to Node-Red using the contrib-telegrambot nodes. When either of the bots sends a message the user group receives the message, and when the user makes a post both bots receive the message. But it looks like there is no way for one bot to receive the message of the other bot when posted in the group, at least now way I have figured out.

As a follow on question, is there anyway to do an inverse echo, by this I mean in the examples it shows a message received, then Node-Red echos the message back to the user. Can you have the echo around the other way, where the bot sends a message and has the same message echoed back (as a kind of confirmation the message was delivered). I think the answer to this is no as well, as it is a bot talking to itself.

That is correct, that is a deliberate design choice to prevent bot loops and other nastiness.

Yes, that is easy.

Sort of. But the user has to send something in Telegram. It can't happen automatically without an external 3rd-party tool doing "robotic" automation of Telegram.

Thanks. I think there could be a way reflecting on this over night.

Searching through the telegram API it seems you can control your Telegram account (not a bot) through a CLI.

So I think you could download the Telegram CLI to machine 1, use your mobile number linked account, control Telegram using an Exec node from Node-Red and talk to another machine 2 Node-Red instance outside the LAN that is running a Telegram bot. Then you get full two way communication as it is account talking to bot. Has anyone done this yet, think that would work?

I think that it is safe to say that you are forging a new path here :smiley:

But I'm interested in how you get on, please let us know. Should be pretty easy to test.

Also note that you should be able to run the CLI on Windows if you need to simply by using the Windows Subsystem for Linux (WSL).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.