Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SelectMenuInteractions): add values property #8805

Merged
merged 6 commits into from Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/role ids
jaw0r3k marked this conversation as resolved.
Show resolved Hide resolved
* @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 @@ -2370,8 +2370,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>
jaw0r3k marked this conversation as resolved.
Show resolved Hide resolved
>;
public inGuild(): this is UserSelectMenuInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is UserSelectMenuInteraction<'cached'>;
public inRawGuild(): this is UserSelectMenuInteraction<'raw'>;
Expand All @@ -2389,7 +2393,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 @@ -2407,9 +2412,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 @@ -2427,7 +2436,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