daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top