diff --git a/server/notification-providers/telegram.js b/server/notification-providers/telegram.js index 2b057622..9c8f5750 100644 --- a/server/notification-providers/telegram.js +++ b/server/notification-providers/telegram.js @@ -9,11 +9,20 @@ class Telegram extends NotificationProvider { let okMsg = "Sent Successfully."; try { + const paramsObj = + { + chat_id: notification.telegramChatID, + text: msg, + disable_notification: notification.telegramSilentNotification ?? false, + protect_content: notification.telegramProtectContent ?? false, + + }; + // if telegramChatThread specified, then add it to paramsObj + if (notification.telegramChatThread && notification.telegramChatThread.length > 0) { + paramsObj.message_thread_id = notification.telegramChatThread; + } await axios.get(`https://api.telegram.org/bot${notification.telegramBotToken}/sendMessage`, { - params: { - chat_id: notification.telegramChatID, - text: msg, - }, + params: paramsObj }); return okMsg; diff --git a/src/components/notifications/Telegram.vue b/src/components/notifications/Telegram.vue index 9daf31ac..9b373b99 100644 --- a/src/components/notifications/Telegram.vue +++ b/src/components/notifications/Telegram.vue @@ -29,6 +29,40 @@
+ +