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:
parent
ab57916a52
commit
ff3c02bcec
3 changed files with 9 additions and 15 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue