3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 19:17:19 +00:00

fix: better fix for embed/embeds

This commit is contained in:
Dragory 2025-05-31 23:09:09 +00:00
parent ab57916a52
commit ff3c02bcec
No known key found for this signature in database
3 changed files with 9 additions and 15 deletions

View file

@ -270,6 +270,13 @@ export const zStrictMessageContent = z.strictObject({
content: z.string().optional(),
tts: z.boolean().optional(),
embeds: z.array(zEmbedInput).optional(),
embed: zEmbedInput.optional(),
}).transform((data) => {
if (data.embed) {
data.embeds = [data.embed];
delete data.embed;
}
return data as StrictMessageContent;
});
export type ZStrictMessageContent = z.infer<typeof zStrictMessageContent>;