Skip to content

Instantly share code, notes, and snippets.

@sadmonad
sadmonad / send_tg.sh
Created Apr 28, 2021
A simple bash script to send message in Telegram
View send_tg.sh
# Place this script somewhere in your system
# And run it like so: TG_BOT_TOKEN=<token> CHAT_ID=<chat_id> send_tg.sh <message>
#!/bin/zsh
MSG="$1"
if [[ ! "$TG_BOT_TOKEN" || ! "$CHAT_ID" ]]; then
echo "\"TG_BOT_TOKEN\" and \"CHAT_ID\" environment variables must be set!"
exit 127
fi