Skip to content

Commit

Permalink
feat(SelectMenuInteractions): add values property (#8805)
Browse files Browse the repository at this point in the history
* fix: add values property

* fix: improve wording

* Update packages/discord.js/src/structures/MentionableSelectMenuInteraction.js

Co-authored-by: Aura Román <kyradiscord@gmail.com>

Co-authored-by: Aura Román <kyradiscord@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 19, 2022
1 parent abefc4f commit b2fabd1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
Expand Up @@ -11,6 +11,12 @@ class ChannelSelectMenuInteraction extends MessageComponentInteraction {
constructor(client, data) {
super(client, data);

/**
* An array of the selected channel ids
* @type {Snowflake[]}
*/
this.values = data.data.values ?? [];

/**
* Collection of the selected channels
* @type {Collection<Snowflake, Channel|APIChannel>}
Expand Down
Expand Up @@ -12,6 +12,12 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction {
constructor(client, data) {
super(client, data);

/**
* An array of the selected user and role ids
* @type {Snowflake[]}
*/
this.values = data.data.values ?? [];

const { members, users, roles } = data.data.resolved ?? {};

/**
Expand Down
Expand Up @@ -11,6 +11,12 @@ class RoleSelectMenuInteraction extends MessageComponentInteraction {
constructor(client, data) {
super(client, data);

/**
* An array of the selected role ids
* @type {Snowflake[]}
*/
this.values = data.data.values ?? [];

/**
* Collection of the selected roles
* @type {Collection<Snowflake, Role|APIRole>}
Expand Down
Expand Up @@ -12,6 +12,12 @@ class UserSelectMenuInteraction extends MessageComponentInteraction {
constructor(client, data) {
super(client, data);

/**
* An array of the selected user ids
* @type {Snowflake[]}
*/
this.values = data.data.values ?? [];

/**
* Collection of the selected users
* @type {Collection<Snowflake, User>}
Expand Down
23 changes: 18 additions & 5 deletions packages/discord.js/typings/index.d.ts
Expand Up @@ -2371,8 +2371,12 @@ export class UserSelectMenuInteraction<
UserSelectMenuComponent | APIUserSelectComponent
>;
public componentType: ComponentType.UserSelect;
public values: Snowflake[];
public users: Collection<Snowflake, User>;
public members: Collection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIGuildMember>>;
public members: Collection<
Snowflake,
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
>;
public inGuild(): this is UserSelectMenuInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is UserSelectMenuInteraction<'cached'>;
public inRawGuild(): this is UserSelectMenuInteraction<'raw'>;
Expand All @@ -2390,7 +2394,8 @@ export class RoleSelectMenuInteraction<
RoleSelectMenuComponent | APIRoleSelectComponent
>;
public componentType: ComponentType.RoleSelect;
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
public values: Snowflake[];
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
public inGuild(): this is RoleSelectMenuInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is RoleSelectMenuInteraction<'cached'>;
public inRawGuild(): this is RoleSelectMenuInteraction<'raw'>;
Expand All @@ -2408,9 +2413,13 @@ export class MentionableSelectMenuInteraction<
MentionableSelectMenuComponent | APIMentionableSelectComponent
>;
public componentType: ComponentType.MentionableSelect;
public values: Snowflake[];
public users: Collection<Snowflake, User>;
public members: Collection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIGuildMember>>;
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
public members: Collection<
Snowflake,
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
>;
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
public inGuild(): this is MentionableSelectMenuInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is MentionableSelectMenuInteraction<'cached'>;
public inRawGuild(): this is MentionableSelectMenuInteraction<'raw'>;
Expand All @@ -2428,7 +2437,11 @@ export class ChannelSelectMenuInteraction<
ChannelSelectMenuComponent | APIChannelSelectComponent
>;
public componentType: ComponentType.ChannelSelect;
public channels: Collection<Snowflake, CacheTypeReducer<Cached, Channel, APIChannel>>;
public values: Snowflake[];
public channels: Collection<
Snowflake,
CacheTypeReducer<Cached, Channel, APIChannel, Channel | APIChannel, Channel | APIChannel>
>;
public inGuild(): this is ChannelSelectMenuInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is ChannelSelectMenuInteraction<'cached'>;
public inRawGuild(): this is ChannelSelectMenuInteraction<'raw'>;
Expand Down

0 comments on commit b2fabd1

Please sign in to comment.