Last active
December 10, 2019 12:55
-
-
Save ddepaoli3/495bb416217c97f9c1da1e5c7d84752a to your computer and use it in GitHub Desktop.
Send message to telegram with curl
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
#!/bin/bash | |
#HOW TO USE SCRIPT: | |
# curl https://gist.githubusercontent.com/ddepaoli3/495bb416217c97f9c1da1e5c7d84752a/raw/549b7aaad6529379297f62682f10887a725bde41/send_message_to_telegram.sh | bash /dev/stdin '<message>' '<chat_id>' '<chat_token>' | |
# | |
MESSAGE=$1 | |
CHAT_ID=$2 | |
TOKEN=$3 | |
if [[ $# -ne 3 ]] | |
then | |
echo "Errore" | |
exit -1 | |
fi | |
curl -s -X POST https://api.telegram.org/bot$TOKEN/sendMessage -d chat_id=$CHAT_ID -d text="$MESSAGE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment