From 34708d6d18f94b5c8d9c582973d057e1f89bfe1f Mon Sep 17 00:00:00 2001 From: monbrey Date: Mon, 5 Jul 2021 22:39:21 +1000 Subject: [PATCH] fix(SelectMenuInteraction): set values to empty array if not provided (#6045) --- src/structures/SelectMenuInteraction.js | 2 +- typings/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/SelectMenuInteraction.js b/src/structures/SelectMenuInteraction.js index be4f3a0ed649..42ef0c1069ff 100644 --- a/src/structures/SelectMenuInteraction.js +++ b/src/structures/SelectMenuInteraction.js @@ -14,7 +14,7 @@ class SelectMenuInteraction extends MessageComponentInteraction { * The values selected, if the component which was interacted with was a select menu * @type {string[]} */ - this.values = this.componentType === 'SELECT_MENU' ? data.data.values : null; + this.values = data.data.values ?? []; } } diff --git a/typings/index.d.ts b/typings/index.d.ts index 630bea213a3e..472d39d46a85 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1367,7 +1367,7 @@ export class Role extends Base { export class SelectMenuInteraction extends MessageComponentInteraction { public componentType: 'SELECT_MENU'; - public values: string[] | null; + public values: string[]; } export class Shard extends EventEmitter {