Send telegram messages from your shell.
Add the content of tg_send.sh to your .bashrc/profile/bash_alias (the one you like the most).
# to send a message use
tg_send_msg $TG_USER_ID $MESSAGE
# to send a file use
tg_send_file $TG_USER_ID $FILE_LOCATION $OPTIONAL_CAPTION
# you can get your user id from @userinfobot
# you can use pipes
echo "lololol" | tg_send_msg $TG_USER_ID
# with files too
echo "my contents!" | tg_send_file $TG_USER_ID $FILE_NAME $OPTIONAL_CAPTION
- Messages: Telegram has a fixed message width limit of 4096 UTF-8 characters, and you can clearly see that there is no segmentation if message is too long. So beware.
- Files: Telegram has a limit for photo size of 10MB, and 50MB of other types. Keep it in mind when using this script.