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:
Naiyar
2025-10-15 00:02:10 +06:00
committed by GitHub
parent 93e96eb6c0
commit 1a305fe4ad
13 changed files with 36 additions and 31 deletions

View File

@@ -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}`);
}
}

View File

@@ -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,
};