3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

fix: corect embed schemas

Correct embed schemas according to the Discord documentation.

Notable change: fixes ability to set `icon_url` to `author` in embeds.
This commit is contained in:
Sasha Sorokin 2023-08-19 22:46:11 +00:00
parent 5a4e50b19d
commit 6d72f087c0

View file

@ -275,6 +275,7 @@ export const tEmbed = t.type({
video: tNullable( video: tNullable(
t.type({ t.type({
url: tNullable(t.string), url: tNullable(t.string),
proxy_url: tNullable(t.string),
width: tNullable(t.number), width: tNullable(t.number),
height: tNullable(t.number), height: tNullable(t.number),
}), }),
@ -298,8 +299,8 @@ export const tEmbed = t.type({
t.type({ t.type({
name: t.string, name: t.string,
url: tNullable(t.string), url: tNullable(t.string),
width: tNullable(t.number), icon_url: tNullable(t.string),
height: tNullable(t.number), proxy_icon_url: tNullable(t.string),
}), }),
), ),
}); });
@ -315,12 +316,14 @@ export const zEmbedInput = z.object({
z.object({ z.object({
text: z.string(), text: z.string(),
icon_url: z.string().optional(), icon_url: z.string().optional(),
proxy_icon_url: z.string().optional(),
}), }),
), ),
image: z.optional( image: z.optional(
z.object({ z.object({
url: z.string().optional(), url: z.string().optional(),
proxy_url: z.string().optional(),
width: z.number().optional(), width: z.number().optional(),
height: z.number().optional(), height: z.number().optional(),
}), }),
@ -329,6 +332,7 @@ export const zEmbedInput = z.object({
thumbnail: z.optional( thumbnail: z.optional(
z.object({ z.object({
url: z.string().optional(), url: z.string().optional(),
proxy_url: z.string().optional(),
width: z.number().optional(), width: z.number().optional(),
height: z.number().optional(), height: z.number().optional(),
}), }),
@ -337,6 +341,7 @@ export const zEmbedInput = z.object({
video: z.optional( video: z.optional(
z.object({ z.object({
url: z.string().optional(), url: z.string().optional(),
proxy_url: z.string().optional(),
width: z.number().optional(), width: z.number().optional(),
height: z.number().optional(), height: z.number().optional(),
}), }),
@ -364,8 +369,8 @@ export const zEmbedInput = z.object({
z.object({ z.object({
name: z.string(), name: z.string(),
url: z.string().optional(), url: z.string().optional(),
width: z.number().optional(), icon_url: z.string().optional(),
height: z.number().optional(), proxy_icon_url: z.string().optional(),
}), }),
) )
.nullable(), .nullable(),