mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user