fix(config): add missing editMessage and createForumTopic to Telegram actions schema

The TelegramActionConfig type defines editMessage and createForumTopic
fields, but the corresponding Zod schema was missing them. Because the
schema uses .strict(), users setting these documented config options get
a validation error: "Unrecognized key(s) in object".

Fixes the schema to match the type definition and adds a regression test.
This commit is contained in:
ingyukoh
2026-03-05 14:16:57 +09:00
committed by Altay
parent a84bcf734c
commit 220b7c7481
2 changed files with 17 additions and 0 deletions

View File

@@ -196,4 +196,19 @@ describe("config schema regressions", () => {
expect(res.ok).toBe(true);
});
it("accepts telegram actions editMessage and createForumTopic", () => {
const res = validateConfigObject({
channels: {
telegram: {
actions: {
editMessage: true,
createForumTopic: false,
},
},
},
});
expect(res.ok).toBe(true);
});
});

View File

@@ -244,7 +244,9 @@ export const TelegramAccountSchemaBase = z
sendMessage: z.boolean().optional(),
poll: z.boolean().optional(),
deleteMessage: z.boolean().optional(),
editMessage: z.boolean().optional(),
sticker: z.boolean().optional(),
createForumTopic: z.boolean().optional(),
})
.strict()
.optional(),