Created
January 22, 2023 08:09
-
-
Save hamidfzm/98eeefa769bfd033e12ca2b4b9734bf5 to your computer and use it in GitHub Desktop.
Telegram Bot using cURL and bash (Quick)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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