mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(SelectMenuInteractions): add values property (#8805)
* 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>
This commit is contained in:
@@ -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>}
|
||||
|
||||
@@ -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 ?? {};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>}
|
||||
|
||||
@@ -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>}
|
||||
|
||||
23
packages/discord.js/typings/index.d.ts
vendored
23
packages/discord.js/typings/index.d.ts
vendored
@@ -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'>;
|
||||
@@ -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'>;
|
||||
@@ -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'>;
|
||||
@@ -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'>;
|
||||
|
||||
Reference in New Issue
Block a user