From a7555c9d4deb94aca1ed2f106122f9b6770906e8 Mon Sep 17 00:00:00 2001 From: monbrey Date: Fri, 25 Jun 2021 07:32:18 +1000 Subject: [PATCH] chore: use flatmap Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com> --- src/structures/MessageComponentInteraction.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/structures/MessageComponentInteraction.js b/src/structures/MessageComponentInteraction.js index 11ca46d12b4a..5955265c6dba 100644 --- a/src/structures/MessageComponentInteraction.js +++ b/src/structures/MessageComponentInteraction.js @@ -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; }