mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
fix(MessageComponentInteraction): component getter is not null anymore (#6835)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user