Message Boards Message Boards

Send auto-generated messages to Telegram?

Posted 7 years ago

Hi

I was thinking the other day about a way to send messages with Telegram. This could be used for notifying myself for example if some calculation is completed, or to send auto-generated messages to a list of selected telegram contacts.

I've requested this feature to be added to Mathematica via the feedback form, but I can't be sure how long will it take Wolfram inc. to so. Until then, I was thinking maybe this could be wrapped in a package that can be imported in notebooks, which provides some functions for access tokens and sending messages.

Necessary info could be found here. I myself don't understand these APIs and how to link with them (if I'm using the right terms here!) and so I appreciate any help I can get.

As a side note, it has been some time now that telegram has introduced "bots" (see here) that users can interact with to do things/get information. A futuristic application of this bot platform would be to prompt users for commands, evaluate them with Mathematica in some server and then return the results, but right now, I'm interested in just notifying someone about something.

Also, please note that I'm aware that a similar feature exists in Mathematica using PushBullet, but it isn't very popular and doesn's have the capabilities of Telegram and it requires me to install an extra app.

thanks in advance

POSTED BY: Pooria Soltani
3 Replies

Hello and thank you for you interest on my code.

I have added a minimal demo/tutorial for sending a message to a Telegram user, you may check it here (right-click and save as...). I think this solves the simple scenario.

The ask users for input-evaluate-send result cycle is also covered in a longer demo/tutorial found here. Although it is working, there is an issue explained there (check the info about the LastAnswered parameter) which makes the package non-production ready. I am afraid I lack the time to do this at the moment, but I can provide more information if anyone is interested in trying to do it.

It looks like there is already a GitHub package called TgBot. Is this the type of thing you are looking for? Judging by the name of the author, @Guillermo Hernández, he is the member of this forum and might provide more details.

enter image description here

POSTED BY: Sam Carrettie
Posted 7 years ago

will do! thanks for the advice :-)

I'll try to lure him here, if possible ;-)

POSTED BY: Pooria Soltani
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract