Skip to content

Instantly share code, notes, and snippets.

@pmudry
Forked from dideler/bot.rb
Created November 26, 2018 16:23
Show Gist options
  • Save pmudry/e446bb9e42190dd7ab7440c0c6a54e20 to your computer and use it in GitHub Desktop.
Save pmudry/e446bb9e42190dd7ab7440c0c6a54e20 to your computer and use it in GitHub Desktop.
Sending a notification message to Telegram (via cURL)

Create a bot, gets its API token, get the ID of the channel.

https://core.telegram.org/bots/api#sendmessage

$ curl -X POST \
       -H 'Content-Type: application/json' \
       -d '{"chat_id": "541123411", "text": "This is a test from curl", "disable_notification": true}' \
       https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment