mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
build: bump discord-api-types to 0.38.30 (#11178)
* build: bump discord-api-types to 0.38.30 * chore: slap the errors
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"dependencies": {
|
||||
"@discordjs/util": "workspace:^",
|
||||
"discord-api-types": "^0.38.29",
|
||||
"discord-api-types": "^0.38.30",
|
||||
"ts-mixer": "^6.0.4",
|
||||
"tslib": "^2.8.1",
|
||||
"zod": "^4.1.12"
|
||||
|
||||
@@ -192,6 +192,8 @@ export function createComponentBuilder(
|
||||
return data;
|
||||
}
|
||||
|
||||
// should be removed in https://github.com/discordjs/discord.js/pull/11108
|
||||
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
||||
switch (data.type) {
|
||||
case ComponentType.ActionRow:
|
||||
return new ActionRowBuilder(data);
|
||||
@@ -226,7 +228,8 @@ export function createComponentBuilder(
|
||||
case ComponentType.Label:
|
||||
return new LabelBuilder(data);
|
||||
default:
|
||||
// @ts-expect-error This case can still occur if we get a newer unsupported component type
|
||||
// should be uncommented in https://github.com/discordjs/discord.js/pull/11108
|
||||
/* // @ts-expect-error This case can still occur if we get a newer unsupported component type */
|
||||
throw new Error(`Cannot properly serialize component type: ${data.type}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ export class LabelBuilder extends ComponentBuilder<APILabelComponent> {
|
||||
|
||||
this.data = {
|
||||
...structuredClone(rest),
|
||||
// @ts-expect-error fixed in https://github.com/discordjs/discord.js/pull/11108
|
||||
component: component ? createComponentBuilder(component) : undefined,
|
||||
type: ComponentType.Label,
|
||||
};
|
||||
|
||||
@@ -44,6 +44,7 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
|
||||
|
||||
this.data = {
|
||||
...structuredClone(rest),
|
||||
// @ts-expect-error fixed in https://github.com/discordjs/discord.js/pull/11108
|
||||
components: components.map((component) => createComponentBuilder(component)),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user