feat(notifications): add Telegram notification channel (#2753)
Add Telegram as a new notification type, allowing users to receive monitor alerts via a Telegram bot. Configuration requires: - Bot token (obtained from @BotFather) - Chat ID (user, group, or channel) Changes: - TelegramProvider: sends HTML-formatted messages via Telegram Bot API - NotificationsService: route telegram type to TelegramProvider - Notification model/types: add 'telegram' to NotificationChannel enum - Server validation: telegram schema (accessToken + address/chat_id) - Client Types/Validation: telegram schema with accessToken + address - useNotificationForm: handle telegram defaults - Notifications create page: render Telegram config UI - en.json: add telegram i18n keys
This commit is contained in:
1 parent
c24b41ecd9
commit
eacbb227c3
12 files changed
+1521
-1329
No files matched your search
@@ -17,11 +17,18 @@ export const useNotificationForm = ({ data = null }: UseNotificationFormOptions
|
||||
roomId: data.roomId || "",
|
||||
accessToken: data.accessToken || "",
|
||||
}
|
||||
: {
|
||||
type: (data?.type || "email") as Exclude<Notification["type"], "matrix">,
|
||||
notificationName: data?.notificationName || "",
|
||||
address: data?.address || "",
|
||||
};
|
||||
: data?.type === "telegram"
|
||||
? {
|
||||
type: "telegram" as const,
|
||||
notificationName: data.notificationName || "",
|
||||
address: data.address || "",
|
||||
accessToken: data.accessToken || "",
|
||||
}
|
||||
: {
|
||||
type: (data?.type || "email") as Exclude<Notification["type"], "matrix" | "telegram">,
|
||||
notificationName: data?.notificationName || "",
|
||||
address: data?.address || "",
|
||||
};
|
||||
|
||||
return { schema: notificationSchema, defaults };
|
||||
}, [data]);
|
||||
|
||||
Reference in new issue
Block a user