diff --git a/src/structures/MessageComponentInteraction.js b/src/structures/MessageComponentInteraction.js index d905823c30f5..dae0107e4b72 100644 --- a/src/structures/MessageComponentInteraction.js +++ b/src/structures/MessageComponentInteraction.js @@ -72,15 +72,13 @@ class MessageComponentInteraction extends Interaction { /** * The component which was interacted with - * @type {?(MessageActionRowComponent|APIMessageActionRowComponent)} + * @type {MessageActionRowComponent|APIMessageActionRowComponent} * @readonly */ get component() { - return ( - this.message.components - .flatMap(row => row.components) - .find(component => (component.customId ?? component.custom_id) === this.customId) ?? null - ); + return this.message.components + .flatMap(row => row.components) + .find(component => (component.customId ?? component.custom_id) === this.customId); } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index fb954f29314e..ee7c13343b14 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1415,7 +1415,7 @@ export class MessageCollector extends Collector { export class MessageComponentInteraction extends Interaction { protected constructor(client: Client, data: RawMessageComponentInteractionData); public readonly channel: TextBasedChannels | null; - public readonly component: MessageActionRowComponent | Exclude | null; + public readonly component: MessageActionRowComponent | Exclude; public componentType: Exclude; public customId: string; public channelId: Snowflake;