fix(SelectMenuInteraction): set values to empty array if not provided (#6045)

This commit is contained in:
monbrey
2021-07-05 22:39:21 +10:00
committed by GitHub
parent 1a27f57950
commit 34708d6d18
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ class SelectMenuInteraction extends MessageComponentInteraction {
* The values selected, if the component which was interacted with was a select menu * The values selected, if the component which was interacted with was a select menu
* @type {string[]} * @type {string[]}
*/ */
this.values = this.componentType === 'SELECT_MENU' ? data.data.values : null; this.values = data.data.values ?? [];
} }
} }

2
typings/index.d.ts vendored
View File

@@ -1367,7 +1367,7 @@ export class Role extends Base {
export class SelectMenuInteraction extends MessageComponentInteraction { export class SelectMenuInteraction extends MessageComponentInteraction {
public componentType: 'SELECT_MENU'; public componentType: 'SELECT_MENU';
public values: string[] | null; public values: string[];
} }
export class Shard extends EventEmitter { export class Shard extends EventEmitter {