Skip to content

Commit

Permalink
chore: use flatmap
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com>
  • Loading branch information
monbrey and vaporoxx committed Jun 24, 2021
1 parent 403ace2 commit a7555c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/structures/MessageComponentInteraction.js
Expand Up @@ -58,8 +58,7 @@ class MessageComponentInteraction extends Interaction {
*/
get component() {
return this.message.components
.map(row => row.components)
.flat()
.flatMap(row => row.components)
.find(component => (component.customID ?? component.custom_id) === this.customID) ?? null;
}

Expand Down

0 comments on commit a7555c9

Please sign in to comment.