Skip to content

Instantly share code, notes, and snippets.

@te-online
Last active December 5, 2022 11:58
Show Gist options
  • Save te-online/efd4dd3b4a080ac4ad93c19cc9b02487 to your computer and use it in GitHub Desktop.
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).
#!/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