added topic

Added topic variable, set to 0 if not used.
This commit is contained in:
mag37 2024-03-27 21:52:02 +01:00 committed by GitHub
parent 5513e13109
commit d1bf9256fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,8 @@ send_notification() {
TelegramToken="Your Telegram token here" TelegramToken="Your Telegram token here"
TelegramChatId="Your Telegram ChatId here" TelegramChatId="Your Telegram ChatId here"
TelegramUrl="https://api.telegram.org/bot$TelegramToken" 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" curl -sS -o /dev/null --fail -X POST "$TelegramUrl/sendMessage" -H 'Content-Type: application/json' -d "$TelegramData"