Push Messages from the Command Line to Telegram

Dmitri Popov

Productivity Sauce

Jul 27, 2016 GMT
Dmitri Popov

Besides being an excellent open source messaging app, Telegram has a few clever tricks up its sleeve. This includes support for bots (or accounts operated by software) that can be put to a variety of practical uses. The telegram-sendtool, for example, uses a bot to push notifications and files from the Linux machine to Telegram. To install telegram-send on Ubuntu, run the following commands:

sudo apt install python3-pip
sudo pip3 install telegram-send

Once you've done that, run the sudo telegram-send --configure command, create a new telegram bot, enter its token, and add the generated password.

 

Now you can push messages and files from your Linux machine to Telegram. To send a message, use the telegram-send "O Hai World" command. Sending files is equally easy: telegram-send --file monkey.jpg. telegram-send conveniently integrates with the default browser, so you can send a file by right-clicking on it and choosing Telegram from the Send To context menu.

comments powered by Disqus