Last active
December 5, 2022 11:58
-
-
Save te-online/efd4dd3b4a080ac4ad93c19cc9b02487 to your computer and use it in GitHub Desktop.
A shell file that takes a message to send with a telegram bot (e.g. a system notification).
This file contains 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 -e | |
chatid="CHAT_ID" | |
message=$1 | |
apikey="BOT_TOKEN" | |
curl -G --data-urlencode "chat_id=${chatid}" --data-urlencode "text=${message}" --data-urlencode "parse_mode=Markdown" https://api.telegram.org/bot${apikey}/sendMessage | |
# Usage: sh telegram-notify.sh "Message" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment