Skip to content

Commit

Permalink
A push_impl.telegram.sh: add push backend telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenchen000 committed Oct 21, 2024
1 parent 236d674 commit 9b198e5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions push_impl.telegram.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## --------- push via serverChan

## need conf
# TELEGRAM_BOT_TOKEN=
# TELEGRAM_CHAT_ID=


do_push_telegram(){
local tit="$1"
local msg="$2"

curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-d chat_id="$TELEGRAM_CHAT_ID" \
-d text="== $tit =="$'\n'"$msg"

echo
# echo "==`date -Is`: $tit: $msg" >&2
}

0 comments on commit 9b198e5

Please sign in to comment.