From d1bf9256fa38073aa597cad6234158bad0214ba8 Mon Sep 17 00:00:00 2001 From: mag37 Date: Wed, 27 Mar 2024 21:52:02 +0100 Subject: [PATCH] added topic Added topic variable, set to 0 if not used. --- notify_telegram.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notify_telegram.sh b/notify_telegram.sh index 2850f27..e6da963 100644 --- a/notify_telegram.sh +++ b/notify_telegram.sh @@ -19,7 +19,8 @@ send_notification() { TelegramToken="Your Telegram token here" TelegramChatId="Your Telegram ChatId here" TelegramUrl="https://api.telegram.org/bot$TelegramToken" - TelegramData="{\"chat_id\":\"$TelegramChatId\",\"text\":\"$MessageBody\",\"disable_notification\": false}" + TelegramTopicID=12345678 ## Set to 0 if not using specific topic within chat + TelegramData="{\"chat_id\":\"$TelegramChatId\",\"text\":\"$MessageBody\",\"message_thread_id\":\"$TelegramTopicID\",\"disable_notification\": false}" curl -sS -o /dev/null --fail -X POST "$TelegramUrl/sendMessage" -H 'Content-Type: application/json' -d "$TelegramData"