User Tools

Site Tools


linux:telegram

This is an old revision of the document!


Installing telegram to send notification messages

Intro

If you look on internet, you will found thousands of recipes like this one: install telegram in order to send notification messages from one computer directly to your phone.

My goal with this recipe is to create a telegram_msg command that just send a text message, nothing more.

Although it might seem a simple goal, you will discover that it is not a simple one: the Telegram command line application doesn't have a “send message” combination of arguments to do so. Moreover, a combination of pipes –to simulate a writing from the console– doesn't achieve the desired result because the telegram-cli program doesn't end: it keeps cyling over and over reading nothing from the pipe.

To put things worst, the first command you have to issue in ''telegram-cli'' is contact_list. It's a known error, at least on June, 2015.

Said that, the only approximation to my goal I've seen so far today is:

  • Run telegram-cli as a daemon, and when it starts, issue a contact_list command the first time
  • After that, send the command through netcat (nc) command

Step 1: install necesary packages

$ sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev 
$ sudo apt-get install libevent-1.4-2 libevent1-dev

Step 2: download the project

It is not compulsory to have git installed in the destination machine. You can have git in another machine and use it to download the project:

git clone https://github.com/vysheng/tg.git

The project will appear in a directory called “tg”.

Afterwards you can move the project to the destination machine.

linux/telegram.1434490884.txt.gz · Last modified: 2022/12/02 22:02 (external edit)