From 804ec8f1355c5ce4987ffb27d929e6e66861bf65 Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Wed, 2 Nov 2022 15:18:04 +0100 Subject: [PATCH 1/3] fix: add values property --- .../ChannelSelectMenuInteraction.js | 6 +++++ .../MentionableSelectMenuInteraction.js | 6 +++++ .../structures/RoleSelectMenuInteraction.js | 6 +++++ .../structures/UserSelectMenuInteraction.js | 6 +++++ packages/discord.js/typings/index.d.ts | 23 +++++++++++++++---- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js index 04d076e599f0..dc8197e00088 100644 --- a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js @@ -11,6 +11,12 @@ class ChannelSelectMenuInteraction extends MessageComponentInteraction { constructor(client, data) { super(client, data); + /** + * Array of selected channels' ids + * @type {Snowflake[]} + */ + this.values = data.data.values ?? []; + /** * Collection of the selected channels * @type {Collection} diff --git a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js index bd294a04a74a..cee0eb8d5029 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js @@ -12,6 +12,12 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction { constructor(client, data) { super(client, data); + /** + * Array of mentioned ids + * @type {Snowflake[]} + */ + this.values = data.data.values ?? []; + const { members, users, roles } = data.data.resolved ?? {}; /** diff --git a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js index b45d356a2828..248554274384 100644 --- a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js @@ -11,6 +11,12 @@ class RoleSelectMenuInteraction extends MessageComponentInteraction { constructor(client, data) { super(client, data); + /** + * Array of selected roles' ids + * @type {Snowflake[]} + */ + this.values = data.data.values ?? []; + /** * Collection of the selected roles * @type {Collection} diff --git a/packages/discord.js/src/structures/UserSelectMenuInteraction.js b/packages/discord.js/src/structures/UserSelectMenuInteraction.js index d2af4176a5e7..a13323dcaacd 100644 --- a/packages/discord.js/src/structures/UserSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/UserSelectMenuInteraction.js @@ -12,6 +12,12 @@ class UserSelectMenuInteraction extends MessageComponentInteraction { constructor(client, data) { super(client, data); + /** + * Array of selected users' ids + * @type {Snowflake[]} + */ + this.values = data.data.values ?? []; + /** * Collection of the selected users * @type {Collection} diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 36e3e6a9acfb..87f7a949c352 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2370,8 +2370,12 @@ export class UserSelectMenuInteraction< UserSelectMenuComponent | APIUserSelectComponent >; public componentType: ComponentType.UserSelect; + public values: Snowflake[]; public users: Collection; - public members: Collection>; + public members: Collection< + Snowflake, + CacheTypeReducer + >; public inGuild(): this is UserSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is UserSelectMenuInteraction<'cached'>; public inRawGuild(): this is UserSelectMenuInteraction<'raw'>; @@ -2389,7 +2393,8 @@ export class RoleSelectMenuInteraction< RoleSelectMenuComponent | APIRoleSelectComponent >; public componentType: ComponentType.RoleSelect; - public roles: Collection>; + public values: Snowflake[]; + public roles: Collection>; public inGuild(): this is RoleSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is RoleSelectMenuInteraction<'cached'>; public inRawGuild(): this is RoleSelectMenuInteraction<'raw'>; @@ -2407,9 +2412,13 @@ export class MentionableSelectMenuInteraction< MentionableSelectMenuComponent | APIMentionableSelectComponent >; public componentType: ComponentType.MentionableSelect; + public values: Snowflake[]; public users: Collection; - public members: Collection>; - public roles: Collection>; + public members: Collection< + Snowflake, + CacheTypeReducer + >; + public roles: Collection>; public inGuild(): this is MentionableSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is MentionableSelectMenuInteraction<'cached'>; public inRawGuild(): this is MentionableSelectMenuInteraction<'raw'>; @@ -2427,7 +2436,11 @@ export class ChannelSelectMenuInteraction< ChannelSelectMenuComponent | APIChannelSelectComponent >; public componentType: ComponentType.ChannelSelect; - public channels: Collection>; + public values: Snowflake[]; + public channels: Collection< + Snowflake, + CacheTypeReducer + >; public inGuild(): this is ChannelSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ChannelSelectMenuInteraction<'cached'>; public inRawGuild(): this is ChannelSelectMenuInteraction<'raw'>; From af41fa0b2db76c2ac2a327d9d1133fff2f697b92 Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Fri, 4 Nov 2022 17:27:19 +0100 Subject: [PATCH 2/3] fix: improve wording --- .../discord.js/src/structures/ChannelSelectMenuInteraction.js | 2 +- .../src/structures/MentionableSelectMenuInteraction.js | 2 +- packages/discord.js/src/structures/RoleSelectMenuInteraction.js | 2 +- packages/discord.js/src/structures/UserSelectMenuInteraction.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js index dc8197e00088..0e28c01edd6d 100644 --- a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js @@ -12,7 +12,7 @@ class ChannelSelectMenuInteraction extends MessageComponentInteraction { super(client, data); /** - * Array of selected channels' ids + * An array of the selected channel ids * @type {Snowflake[]} */ this.values = data.data.values ?? []; diff --git a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js index cee0eb8d5029..3d0a8432fccc 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js @@ -13,7 +13,7 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction { super(client, data); /** - * Array of mentioned ids + * An array of the selected user/role ids * @type {Snowflake[]} */ this.values = data.data.values ?? []; diff --git a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js index 248554274384..7c7896329156 100644 --- a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js @@ -12,7 +12,7 @@ class RoleSelectMenuInteraction extends MessageComponentInteraction { super(client, data); /** - * Array of selected roles' ids + * An array of the selected role ids * @type {Snowflake[]} */ this.values = data.data.values ?? []; diff --git a/packages/discord.js/src/structures/UserSelectMenuInteraction.js b/packages/discord.js/src/structures/UserSelectMenuInteraction.js index a13323dcaacd..f6d2623a93ab 100644 --- a/packages/discord.js/src/structures/UserSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/UserSelectMenuInteraction.js @@ -13,7 +13,7 @@ class UserSelectMenuInteraction extends MessageComponentInteraction { super(client, data); /** - * Array of selected users' ids + * An array of the selected user ids * @type {Snowflake[]} */ this.values = data.data.values ?? []; From 49ebe408f534e2e3052b43b7890e9017f35b2686 Mon Sep 17 00:00:00 2001 From: Jaworek Date: Sat, 19 Nov 2022 21:45:04 +0100 Subject: [PATCH 3/3] Update packages/discord.js/src/structures/MentionableSelectMenuInteraction.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aura Román --- .../src/structures/MentionableSelectMenuInteraction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js index 3d0a8432fccc..4e14bda6137b 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js @@ -13,7 +13,7 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction { super(client, data); /** - * An array of the selected user/role ids + * An array of the selected user and role ids * @type {Snowflake[]} */ this.values = data.data.values ?? [];