Last active
December 1, 2021 19:45
-
-
Save ifahadone/0c5c8e086c357c247aa8b138d1fb844a to your computer and use it in GitHub Desktop.
Send Message To Telegram From Shell/Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependency : `Curl` must be preinstalled | |
tgm () { | |
TOKEN="XXXX" | |
ID="-000000" | |
URL="https://api.telegram.org/bot$TOKEN/sendMessage" | |
MSG="$@" | |
process_msg=${MSG// /_} | |
curl -s -X POST $URL -d chat_id=$ID -d text="MSG : $process_msg" | |
} | |
tgm hello world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace
TOKEN
="your-token"ID
="your-id"