diff --git a/server/notification-providers/telegram.js b/server/notification-providers/telegram.js index fb53b971a..7f46b3fc7 100644 --- a/server/notification-providers/telegram.js +++ b/server/notification-providers/telegram.js @@ -9,12 +9,16 @@ class Telegram extends NotificationProvider { let okMsg = "Sent Successfully."; try { + let params = { + chat_id: notification.telegramChatID, + text: msg, + }; + if (notification.telegramMessageThreadID) { + params.message_thread_id = notification.telegramMessageThreadID; + } + await axios.get(`https://api.telegram.org/bot${notification.telegramBotToken}/sendMessage`, { - params: { - chat_id: notification.telegramChatID, - text: msg, - message_thread_id: notification.telegramMessageThreadID, - }, + params: params, }); return okMsg; diff --git a/src/components/notifications/Telegram.vue b/src/components/notifications/Telegram.vue index a1b74a8a9..042774ac1 100644 --- a/src/components/notifications/Telegram.vue +++ b/src/components/notifications/Telegram.vue @@ -17,10 +17,6 @@ - - -

Message Thread ID: Optional Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

-
{{ $t("supportTelegramChatID") }} @@ -32,6 +28,10 @@ {{ telegramGetUpdatesURL("masked") }}

+ + + +

{{ $t("telegramMessageThreadIDDescription") }}

diff --git a/src/lang/ar-SY.json b/src/lang/ar-SY.json index b44ed206c..3a4cf140e 100644 --- a/src/lang/ar-SY.json +++ b/src/lang/ar-SY.json @@ -215,7 +215,7 @@ "Bot Token": "رمز الروبوت", "wayToGetTelegramToken": "يمكنك الحصول على رمز من {0}.", "Chat ID": "معرف الدردشة", - "Message Thread ID": "معرف المواضيع", + "telegramMessageThreadID": "معرف المواضيع", "supportTelegramChatID": "دعم الدردشة المباشرة / معرف الدردشة للقناة", "wayToGetTelegramChatID": "يمكنك الحصول على معرف الدردشة الخاص بك عن طريق إرسال رسالة إلى الروبوت والانتقال إلى عنوان URL هذا لعرض Chat_id", "YOUR BOT TOKEN HERE": "رمز الروبوت الخاص بك هنا", diff --git a/src/lang/bg-BG.json b/src/lang/bg-BG.json index 23e0e5494..ae2cdce61 100644 --- a/src/lang/bg-BG.json +++ b/src/lang/bg-BG.json @@ -210,7 +210,6 @@ "Bot Token": "Бот токен", "wayToGetTelegramToken": "Можете да получите токен от {0}.", "Chat ID": "Чат ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Поддържа Direct Chat / Group / Channel's Chat ID", "wayToGetTelegramChatID": "Можете да получите вашето чат ID, като изпратите съобщение на бота, след което е нужно да посетите този URL адрес за да го видите:", "YOUR BOT TOKEN HERE": "ВАШИЯТ БОТ ТОКЕН ТУК", diff --git a/src/lang/cs-CZ.json b/src/lang/cs-CZ.json index 5981971d4..dc8e26373 100644 --- a/src/lang/cs-CZ.json +++ b/src/lang/cs-CZ.json @@ -215,7 +215,6 @@ "Bot Token": "Token bota", "wayToGetTelegramToken": "Token můžete získat od {0}.", "Chat ID": "ID chatu", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Podpora přímého chatu / skupiny / ID chatu kanálu", "wayToGetTelegramChatID": "ID chatu můžete získat tak, že robotovi zašlete zprávu a přejdete na tuto adresu URL, kde zobrazíte chat_id:", "YOUR BOT TOKEN HERE": "SEM ZADEJTE TOKEN VAŠEHO CHATBOTA", diff --git a/src/lang/da-DK.json b/src/lang/da-DK.json index 02a632205..1b0fe210b 100644 --- a/src/lang/da-DK.json +++ b/src/lang/da-DK.json @@ -208,7 +208,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "Du kan få et token fra {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Support Direct Chat / Group / Channel's Chat ID", "wayToGetTelegramChatID": "Du kan få dit chat-ID ved at sende en besked til bot'en og gå til denne URL for at se chat_id'et:", "YOUR BOT TOKEN HERE": "DIT BOT TOKEN HER", diff --git a/src/lang/de-CH.json b/src/lang/de-CH.json index 7e0f0ebd3..d8a46562e 100644 --- a/src/lang/de-CH.json +++ b/src/lang/de-CH.json @@ -214,7 +214,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "Hier kannst du einen Token erhalten {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Unterstützt Direkt Chat / Gruppe / Kanal Chat-ID's", "wayToGetTelegramChatID": "Du kannst die Chat-ID erhalten, indem du eine Nachricht an den Bot sendest und zu dieser URL gehst, um die chat_id: zu sehen.", "YOUR BOT TOKEN HERE": "HIER DEIN BOT TOKEN", diff --git a/src/lang/de-DE.json b/src/lang/de-DE.json index 37d27a6e3..2e7bbb5f3 100644 --- a/src/lang/de-DE.json +++ b/src/lang/de-DE.json @@ -214,7 +214,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "Hier kannst du einen Token erhalten {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Unterstützt Direkt Chat / Gruppe / Kanal Chat-ID's", "wayToGetTelegramChatID": "Du kannst deine Chat-ID erhalten, indem du eine Nachricht an den Bot sendest und zu dieser URL gehst, um die chat_id: zu sehen.", "YOUR BOT TOKEN HERE": "HIER DEIN BOT TOKEN", diff --git a/src/lang/el-GR.json b/src/lang/el-GR.json index 1f8459f10..19a9bd4c1 100644 --- a/src/lang/el-GR.json +++ b/src/lang/el-GR.json @@ -198,7 +198,6 @@ "Bot Token": "Διακριτικό Bot", "wayToGetTelegramToken": "Μπορείτε να πάρετε ένα διακριτικό από {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Support Direct Chat / Group / Channel's Chat ID", "wayToGetTelegramChatID": "Μπορείτε να λάβετε το αναγνωριστικό συνομιλίας σας στέλνοντας ένα μήνυμα στο bot και μεταβαίνοντας σε αυτήν τη διεύθυνση URL για να προβάλετε το chat_id:", "YOUR BOT TOKEN HERE": "ΤΟ BOT ΣΑΣ ΔΙΑΚΡΙΤΙΚΌ ΕΔΩ", diff --git a/src/lang/en.json b/src/lang/en.json index e70dbb38b..c1249d31a 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -361,7 +361,8 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "You can get a token from {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", + "telegramMessageThreadID": "(Optional) Message Thread ID", + "telegramMessageThreadIDDescription": "Optional Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", "supportTelegramChatID": "Support Direct Chat / Group / Channel's Chat ID", "wayToGetTelegramChatID": "You can get your chat ID by sending a message to the bot and going to this URL to view the chat_id:", "YOUR BOT TOKEN HERE": "YOUR BOT TOKEN HERE", diff --git a/src/lang/nl-NL.json b/src/lang/nl-NL.json index e4c1da002..32c795456 100644 --- a/src/lang/nl-NL.json +++ b/src/lang/nl-NL.json @@ -217,7 +217,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "Je kunt een token krijgen van {0}.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Ondersteuning Directe Chat / Groep / Kanaal Chat ID", "wayToGetTelegramChatID": "Je kunt je CHAT ID krijgen door een bericht te sturen naar de bot en naar deze URL te gaan om het chat_id te bekijken:", "YOUR BOT TOKEN HERE": "DE BOT TOKEN HIER", diff --git a/src/lang/pl.json b/src/lang/pl.json index 6996e761f..472b595c7 100644 --- a/src/lang/pl.json +++ b/src/lang/pl.json @@ -189,7 +189,6 @@ "Bot Token": "Token bota", "wayToGetTelegramToken": "Token można uzyskać z {0}.", "Chat ID": "Identyfikator czatu", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Czat wsparcia technicznego / Bezpośrednia rozmowa / Czat grupowy", "wayToGetTelegramChatID": "Możesz uzyskać swój identyfikator czatu, wysyłając wiadomość do bota i przechodząc pod ten adres URL, aby wyświetlić identyfikator czatu:", "YOUR BOT TOKEN HERE": "TWÓJ TOKEN BOTA", diff --git a/src/lang/ru-RU.json b/src/lang/ru-RU.json index 96ad86617..7ea1f6431 100644 --- a/src/lang/ru-RU.json +++ b/src/lang/ru-RU.json @@ -216,7 +216,6 @@ "Bot Token": "Токен бота", "wayToGetTelegramToken": "Вы можете взять токен здесь - {0}.", "Chat ID": "ID чата", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Поддерживаются ID чатов, групп и каналов", "wayToGetTelegramChatID": "Вы можете взять ID вашего чата, отправив сообщение боту и перейдя по этому URL для просмотра chat_id:", "YOUR BOT TOKEN HERE": "ВАШ ТОКЕН БОТА ЗДЕСЬ", diff --git a/src/lang/sl-SI.json b/src/lang/sl-SI.json index bf32cbeda..f4ca81bd6 100644 --- a/src/lang/sl-SI.json +++ b/src/lang/sl-SI.json @@ -193,7 +193,6 @@ "Bot Token": "Robotkov žetonček", "wayToGetTelegramToken": "Lahko dobiš žeton od {0}.", "Chat ID": "ID pogovora", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Direkten pogovor pomoči / Skupina / ID kanala", "wayToGetTelegramChatID": "Id lahko dobiš, če pošlješ sporočilo robotku in odpreš ta URL, da bi videl chat_id:", "YOUR BOT TOKEN HERE": "ROBOTKOV ŽETON TUKAJ", diff --git a/src/lang/th-TH.json b/src/lang/th-TH.json index 2146c7345..9f5c78a1d 100644 --- a/src/lang/th-TH.json +++ b/src/lang/th-TH.json @@ -194,7 +194,6 @@ "Bot Token": "กุญแจของบอท", "wayToGetTelegramToken": "คุณสามารถรับกุญแจได้จาก {0}.", "Chat ID": "ไอดีแชท", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "รองรับ แชทส่วนตัว, แชทกลุ่ม, ไอดีแชท", "wayToGetTelegramChatID": "คุณสามารถรับ ID แชทของคุณได้โดยส่งข้อความไปยังบอทและไปที่ URL นี้เพื่อดู chat_id :", "YOUR BOT TOKEN HERE": "กุญแจของบอทของคุณที่นี่", diff --git a/src/lang/tr-TR.json b/src/lang/tr-TR.json index d55f2aab8..80d273e1e 100644 --- a/src/lang/tr-TR.json +++ b/src/lang/tr-TR.json @@ -197,7 +197,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "{0} adresinden bir token alabilirsiniz.", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Doğrudan Sohbet / Grup / Kanalın Sohbet Kimliğini Destekleyin", "wayToGetTelegramChatID": "Bot'a bir mesaj göndererek ve chat_id'yi görüntülemek için bu URL'ye giderek sohbet kimliğinizi alabilirsiniz:", "YOUR BOT TOKEN HERE": "BOT TOKENİNİZ BURADA", diff --git a/src/lang/uk-UA.json b/src/lang/uk-UA.json index 7de6829c5..9a63cfe07 100644 --- a/src/lang/uk-UA.json +++ b/src/lang/uk-UA.json @@ -216,7 +216,6 @@ "Bot Token": "Токен бота", "wayToGetTelegramToken": "Ви можете взяти токен тут - {0}.", "Chat ID": "ID чату", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Підтримуються ID чатів, груп та каналів", "wayToGetTelegramChatID": "Ви можете взяти ID вашого чату, відправивши повідомлення боту і перейшовши по цьому URL для перегляду chat_id:", "YOUR BOT TOKEN HERE": "ВАШ ТОКЕН БОТА ТУТ", diff --git a/src/lang/vi-VN.json b/src/lang/vi-VN.json index 4446a0203..165bf1bb8 100644 --- a/src/lang/vi-VN.json +++ b/src/lang/vi-VN.json @@ -193,7 +193,6 @@ "Bot Token": "Bot Token", "wayToGetTelegramToken": "Bạn có thể lấy mã token từ", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "Hỗ trợ chat trực tiếp / Nhóm / Kênh Chat ID", "wayToGetTelegramChatID": "Bạn có thể lấy chat id của mình bằng cách gửi tin nhắn tới bot và truy cập url này để xem chat_id:", "YOUR BOT TOKEN HERE": "MÃ BOT TOKEN CỦA BẠN", diff --git a/src/lang/zh-CN.json b/src/lang/zh-CN.json index 8bad70ab0..a05395939 100644 --- a/src/lang/zh-CN.json +++ b/src/lang/zh-CN.json @@ -213,7 +213,6 @@ "Bot Token": "机器人令牌", "wayToGetTelegramToken": "您可以从 {0} 获取 Token。", "Chat ID": "Chat ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "支持对话/群组/频道的 Chat ID", "wayToGetTelegramChatID": "您可以发送一条消息给您的机器人,然后访问此链接来查看 chat_id:", "YOUR BOT TOKEN HERE": "这里替换成您的 BOT TOKEN", diff --git a/src/lang/zh-HK.json b/src/lang/zh-HK.json index 1d7e0e651..8111b73dd 100644 --- a/src/lang/zh-HK.json +++ b/src/lang/zh-HK.json @@ -211,7 +211,6 @@ "Bot Token": "機器人權杖", "wayToGetTelegramToken": "您可以從 {0} 取得 Token。", "Chat ID": "聊天 ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "支援 對話/群組/頻道的聊天 ID", "wayToGetTelegramChatID": "傳送訊息給機器人,並前往以下網址以取得您的 chat ID:", "YOUR BOT TOKEN HERE": "在此填入您的機器人權杖", diff --git a/src/lang/zh-TW.json b/src/lang/zh-TW.json index 5a63ac542..3e2082159 100644 --- a/src/lang/zh-TW.json +++ b/src/lang/zh-TW.json @@ -212,7 +212,6 @@ "Bot Token": "機器人權杖", "wayToGetTelegramToken": "您可以從 {0} 取得權杖。", "Chat ID": "聊天 ID", - "Message Thread ID": "Message Thread ID", "supportTelegramChatID": "支援 對話/群組/頻道的聊天 ID", "wayToGetTelegramChatID": "傳送訊息給機器人,並前往以下網址以取得您的 chat ID:", "YOUR BOT TOKEN HERE": "在此填入您的機器人權杖",