From d449547336bba57f680770d78700c4af23a1a173 Mon Sep 17 00:00:00 2001 From: Didin Sino Date: Wed, 28 Jan 2026 01:43:05 +0700 Subject: [PATCH] feat: add support for sending notifications to Telegram group topics (#401) --- .../components/create-notification-form.tsx | 1 + .../notification-forms/telegram-form.tsx | 14 ++++++++++++++ app/schemas/notifications.ts | 1 + .../modules/notifications/builders/telegram.ts | 6 +++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/client/modules/notifications/components/create-notification-form.tsx b/app/client/modules/notifications/components/create-notification-form.tsx index 07608605..6e669e4d 100644 --- a/app/client/modules/notifications/components/create-notification-form.tsx +++ b/app/client/modules/notifications/components/create-notification-form.tsx @@ -86,6 +86,7 @@ const defaultValuesForType = { type: "telegram" as const, botToken: "", chatId: "", + threadId: "", }, generic: { type: "generic" as const, diff --git a/app/client/modules/notifications/components/notification-forms/telegram-form.tsx b/app/client/modules/notifications/components/notification-forms/telegram-form.tsx index 0ff66c64..e7691bb2 100644 --- a/app/client/modules/notifications/components/notification-forms/telegram-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/telegram-form.tsx @@ -39,6 +39,20 @@ export const TelegramForm = ({ form }: Props) => { )} /> + ( + + Thread ID (Optional) + + + + Telegram Group Topic ID to send notifications to. + + + )} + /> ); }; diff --git a/app/schemas/notifications.ts b/app/schemas/notifications.ts index e5cc379a..124e450b 100644 --- a/app/schemas/notifications.ts +++ b/app/schemas/notifications.ts @@ -71,6 +71,7 @@ export const telegramNotificationConfigSchema = type({ type: "'telegram'", botToken: "string", chatId: "string", + threadId: "string?", }); export const genericNotificationConfigSchema = type({ diff --git a/app/server/modules/notifications/builders/telegram.ts b/app/server/modules/notifications/builders/telegram.ts index 3ba01dea..811afbfb 100644 --- a/app/server/modules/notifications/builders/telegram.ts +++ b/app/server/modules/notifications/builders/telegram.ts @@ -1,5 +1,9 @@ import type { NotificationConfig } from "~/schemas/notifications"; export const buildTelegramShoutrrrUrl = (config: Extract) => { - return `telegram://${config.botToken}@telegram?channels=${config.chatId}`; + let shoutrrrUrl = `telegram://${config.botToken}@telegram?channels=${config.chatId}`; + if (config.threadId) { + shoutrrrUrl += `:${config.threadId}`; + } + return shoutrrrUrl; };