Skip to content

Instantly share code, notes, and snippets.

@hamidfzm
Created January 22, 2023 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamidfzm/98eeefa769bfd033e12ca2b4b9734bf5 to your computer and use it in GitHub Desktop.
Save hamidfzm/98eeefa769bfd033e12ca2b4b9734bf5 to your computer and use it in GitHub Desktop.
Telegram Bot using cURL and bash (Quick)
#!/bin/bash
CHAT_ID="Your chat id"
TOKEN="Your token"
APP=$1
TITLE=$2
BODY=$3
TIME=$(/opt/homebrew/bin/gdate -d "@$4")
curl -sS \
--data parse_mode=HTML \
--data chat_id=$CHAT_ID \
--data text="<b>🔔 $TITLE</b>%0A🕰 $TIME%0A📌 $APP%0A%0A$BODY" \
--request POST "https://api.telegram.org/bot$TOKEN/sendMessage" > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment