Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. # tg_send
  2. Send telegram messages from your shell.
  3.  
  4. ## Install
  5. Add the content of tg_send.sh to your .bashrc/profile/bash_alias (the one you like the most).
  6.  
  7. ```bash
  8. # to send a message use
  9. tg_send_msg $TG_USER_ID $MESSAGE
  10. # to send a file use
  11. tg_send_file $TG_USER_ID $FILE_LOCATION $OPTIONAL_CAPTION
  12. # you can get your user id from @userinfobot
  13.  
  14. # you can use pipes
  15. echo "lololol" | tg_send_msg $TG_USER_ID
  16. # with files too
  17. echo "my contents!" | tg_send_file $TG_USER_ID $FILE_NAME $OPTIONAL_CAPTION
  18. ```
  19.  
  20. ## Limitations
  21. 1. **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.
  22. 2. **Files:** Telegram has a limit for photo size of 10MB, and 50MB of other types. Keep it in mind when using this script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement