curl
: command-line tool for transferring data with URLsjq
: lightweight and flexible command-line JSON processor
Firstly, you need to export BOT_TOKEN
and CHAT_ID
:
export BAT_TOKEN="<your_bot_token>"
export CHAT_ID="<your_chat_id>"
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json; charset=utf-8" \
-d "{
\"chat_id\": \"${CHAT_ID}\",
\"text\": \"Simple Text\",
\"parse_mode\": \"Markdown\",
\"disable_web_page_preview\": true,
\"disable_notification\": true,
}"