From 9b198e5f3bc4b74ad9ef72dc555196cc71d516a0 Mon Sep 17 00:00:00 2001 From: chen Date: Tue, 22 Oct 2024 01:57:52 +0800 Subject: [PATCH] A push_impl.telegram.sh: add push backend telegram --- push_impl.telegram.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 push_impl.telegram.sh diff --git a/push_impl.telegram.sh b/push_impl.telegram.sh new file mode 100644 index 0000000..d18dca6 --- /dev/null +++ b/push_impl.telegram.sh @@ -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 +} +