How to send text and files to other devices in Linux command line via Telegram
If you work on Linux command line very often, sometimes you may want to send text, files to your devices. telegram-send is such a tool to allow you sending messages across devices. Here is how to do it on Ubuntu 16:
Install telegram-send
To install telegram-send, run this command:
pip3 install telegram-send
Configure telegram
Assuming you already have a telegram account. If not, you need to register a telegram account: https://telegram.org/
Then run command:
$ telegram-send --configure
You will see the output like:
Talk with the BotFather on Telegram (https://telegram.me/BotFather), create a bot and insert the token
Now you need to create a telegram bot to deal with your requests. Open: https://telegram.me/BotFather, click "OPEN IN WEB"
Enter ‘/newbot’ then ‘YOUR_BOT_NAME’ to create a bot. Once you finish, you will see the response from BotFather:
Copy the token given by the BotFather and paste it to the command line window and you will see a message from command line window like:
Please add YOUR_BOT_NAME on Telegram (https://telegram.me/XXXX_bot)
and send it the password: YYYYYY
Follow the above instruction and enter the password in your browser, you will eventually see the message:
Congratulations XXXX!
telegram-send is now ready for use!
Now you may want to install Telegram to your devices. Actually, Telegram has native app on every device:
Test
To send a text to Telegram, just enter:
telegram-send "Hello, telegram"
To send an image, enter:
telegram-send --image 1.png --caption "optional image title"
To send a file, enter:
telegram-send --file FILENAME
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thank you
Very nice apps
Hey @yuxid I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x