Sending a variable message to Telegram

236 views
Skip to first unread message

Mauro

unread,
Jun 23, 2022, 3:27:57 AM6/23/22
to Automate
I'm trying to send a message to Telegram, but instead that a text it should be the content of a variable; I managed to send a text following what was said here: https://groups.google.com/g/automate-user/c/a48hE3RP4kg/m/4OSPS31oAQAJ, but I was unable to send the message directly (I have to select the chat), and just replacing the text with the variable (without quote) doesn't work.

Is it possible to send a variable text without having to select the chat (or, if not, selecting it)?

Henrik "The Developer" Lindqvist

unread,
Jun 23, 2022, 7:17:43 AM6/23/22
to Automate
If it can send text, it can surely include a variable, see: https://llamalab.com/automate/doc/value.html#string_interpolation

P. Andreas Schmidt, IVE

unread,
Jul 14, 2022, 4:17:16 AM7/14/22
to Automate
Mauro, could you show us your Start App block the way you have it, so we can better help you? Or did Hendrik's answer solve it for you?

Mauro

unread,
Jul 14, 2022, 4:49:47 AM7/14/22
to Automate
Hendrik's answer solved the variable part, not the automatic send part, but that was unsolved also in the previous questions so maybe there were some issue in solving that?

My App start block is:

Package: org.telegram.messenger

Activity class: org.telegram.ui.LaunchActivity

Action: Send

Extras: {"android.intent.extra.TEXT":"{clipboard}"}

To  send to a specific contact I added as Data URI tel:+xxxxxxx, http://telegram.me/+user_id and http://telegram.me/user_id, but with all of them it keeps asking to select the destination chat.

P. Andreas Schmidt, IVE

unread,
Jul 14, 2022, 5:01:38 AM7/14/22
to Automate
Well, check out the thread here where this subject is being discussed, and as a matter of fact I had just posted saying that after a quick search on the internet it doesn't seem to be possible (with Telegram) except for through the API (not intent.Send) Have a look at it. And do some more research on the internet.
And what you do with the variable works, but you could do it even "simpler": just put in clipboard (the variable name), without curly brackets and "". With a string as in this case both work, but for example if you wanted to pass on an array of fileUri's (if that works with Telegram I don't know, I'm speaking more from experience with WhatsApp) then the only way would be to pass it on directly as a variable, i.e. just put in the variable name.

Reply all
Reply to author
Forward
0 new messages