Telegram integration

1,658 views
Skip to first unread message

matteo.g...@gmail.com

unread,
Jan 14, 2016, 2:10:51 AM1/14/16
to Automate
Hello,

is there any way to program Automate in order to send a Telegram message - supposing Telegram is installed?

Thank you!

Henrik "The Developer" Lindqvist

unread,
Jan 15, 2016, 1:47:30 PM1/15/16
to Automate, matteo.g...@gmail.com
Sending any kind of "message" can usually be done using the App start block with Send action and Extras { "android.intent.extra.TITLE": "Hello World" }

Matteo Giacomazzi

unread,
Jan 15, 2016, 3:57:12 PM1/15/16
to Henrik "The Developer" Lindqvist, Automate

That looks interesting, I will give it a try! Thank you!

Henrik "The Developer" Lindqvist

unread,
Jan 15, 2016, 5:22:59 PM1/15/16
to Automate, henrik.l...@gmail.com, matteo.g...@gmail.com
I copied the wrong Extras, it should be: { "android.intent.extra.TEXT": "Hello World" }
Also, the Data URI is often used for the "address" of the recipient, usually an smsto:<recipient phone number> or tel:<recipient phone number>


On Friday, January 15, 2016 at 9:57:12 PM UTC+1, Matteo Giacomazzi wrote:

That looks interesting, I will give it a try! Thank you!


Adriano Marzano de Carvalho

unread,
Jan 15, 2016, 11:08:56 PM1/15/16
to Automate
Sorry Henrik, but does that work for WhatsApp?
I'm asking that because Telegram works the same way as WhatsApp, and so far I've been using it worth interact block.

Regards.

Henrik "The Developer" Lindqvist

unread,
Jan 16, 2016, 1:13:26 AM1/16/16
to Automate

Adriano Marzano de Carvalho

unread,
Jan 16, 2016, 8:44:45 AM1/16/16
to Automate
Thanks, I'll give it a try.

Ps: last post, with x worth. Auto-correct :(

Leeroy

unread,
Apr 27, 2018, 5:40:57 AM4/27/18
to automa...@googlegroups.com
App start block:

Package: org.telegram.messenger
Activity class: org.telegram.ui.LaunchActivity
Action: Send
Extras: "android.intent.extra.TEXT": "Hello World" }

android.intent.extra.TITLE  or .SUBJECT don't do anything

This prompts the user to select a chat, then directly sends Hello World to it.

s.dhi...@gmail.com

unread,
May 8, 2018, 4:52:49 AM5/8/18
to Automate
Hi Henrik,

I tried the code u posted below, however, instead of sending the "hello world" message directly to my desired contact, telegram prompts me to select a chat to send that message to. 
I live in Singapore and our mobile numbers start with +65. I was wondering if I am inputting something wrong in the DATA URI part.
What i put in the DATA URI part   tel:<+65-xxxx-xxxx>

Henrik "The Developer" Lindqvist

unread,
May 8, 2018, 2:28:57 PM5/8/18
to Automate
There's no <, > or - in the URI, just + and digits.

s.dhi...@gmail.com

unread,
May 9, 2018, 5:51:02 AM5/9/18
to Automate
Hi Henrik,

I tried it with
tel:+65xxxxxxxx
and just + followed by the numbers but the system still prompts me to select a chat.
i was wondering if we could use some other data type for the URI
What i can think of:
Telegram ID,
Telegram user name,
or simply the URL of the telegram chat.
However I am unsure of the format to input this information if at all possible.
Any ideas? 
Many thanks!

Henrik "The Developer" Lindqvist

unread,
May 9, 2018, 2:09:11 PM5/9/18
to Automate

weissing...@gmail.com

unread,
May 28, 2018, 11:39:42 AM5/28/18
to Automate
Unfortunately, this doesn't work... Any other idea on that issue? :/ 

in...@barion.koeln

unread,
Feb 12, 2019, 3:56:42 AM2/12/19
to Automate

Hallo Leeroy,

Do you also have the App Start Block for
the measuring threema.
That would be great.

Robert

Anton Kravtsov

unread,
Aug 25, 2020, 12:04:35 PM8/25/20
to Automate
Has anyone succeeded with sending a message to Telegram chat (group) directly (via Telegram app using an intent)?

Posting messages via Telegram API (via bot, for instance) works fine if phone is always online.

вівторок, 12 лютого 2019 р. о 11:56:42 UTC+3 in...@barion.koeln пише:

P. Andreas Schmidt, IVE

unread,
Jul 14, 2022, 4:31:40 AM7/14/22
to Automate
Well I'm no expert on this, but a quick search on the internet (at least looking at more recent posts) some explicitly state that the only way to do this is through the API, as Anton also says it works. 
With WhatsApp there's a special "jid" element you can specify with the phone number to directly pass your message/files through intent. I got that from someone on the AM-WA group who had searched through the WA-manifest and found it. Haps there's something similar, "unofficial" in Telegram, but I doubt it. It might just be a privacy thing, or since they've got their API why bother with...
Well, apart from using the API, I only see two "manual" automisation solutions as possibilities:
a) with the intent as posted here and then use the Interact blocks to hit the right chat... I've seen flows on the community that do that for WhatsApp, so it might also work for Telegram.
b) use the other intent with the telegram link and id as Hendrik posted (with link), that will open the chat, and then use the Automate keyboard to type in the message (you'd probalby still have to use the interact block to hit the message field, and after typing in the message, again to hit the send button).

If anyone has some better info/solution?

P. Andreas Schmidt, IVE

unread,
Jul 14, 2022, 4:37:27 AM7/14/22
to Automate
Hey adriano,

WhatsApp does also work with the Start app block and intents, and as I posted below, it's also possible to specify directly a contact. Check out my two flows to get an idea how you can do it:
This one just send one message/file to one contact:

In this flow you can specify a text message, select multiple files to be sent consecutively to multiple contacts:

Even so, as you will see in the last flow, it still needs some interaction in order to be fully automated, since WA will not send text messages directly to a contact without you hitting the send button, and if you send files it will first ask for confirmation whether you really want to do this, so again, you have to hit "OK".

So yeah... there's that. If you don't specify a number, you'll get the contact picker activity

P. Andreas Schmidt, IVE

unread,
Jul 16, 2022, 6:58:06 AM7/16/22
to Automate
Another suggestion: perhaps ask in the Telegram AM group, since all the guys there use Telegram, someone might know how/best way to do it!
Reply all
Reply to author
Forward
0 new messages