feat: notifications to specific Telegram topics

This commit is contained in:
vicke4
2025-02-13 22:20:52 +05:30
parent 209029214e
commit e228325e37
7 changed files with 4524 additions and 1 deletions

View File

@@ -65,6 +65,7 @@ export const telegram = pgTable("telegram", {
.$defaultFn(() => nanoid()),
botToken: text("botToken").notNull(),
chatId: text("chatId").notNull(),
messageThreadId: text("messageThreadId"),
});
export const discord = pgTable("discord", {
@@ -169,6 +170,7 @@ export const apiCreateTelegram = notificationsSchema
.extend({
botToken: z.string().min(1),
chatId: z.string().min(1),
messageThreadId: z.string()
})
.required();
@@ -181,6 +183,7 @@ export const apiUpdateTelegram = apiCreateTelegram.partial().extend({
export const apiTestTelegramConnection = apiCreateTelegram.pick({
botToken: true,
chatId: true,
messageThreadId: true,
});
export const apiCreateDiscord = notificationsSchema