Skip to content

Commit b2fabd1

Browse files
jaw0r3kkyranetkodiakhq[bot]
authored
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>
1 parent abefc4f commit b2fabd1

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

packages/discord.js/src/structures/ChannelSelectMenuInteraction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ class ChannelSelectMenuInteraction extends MessageComponentInteraction {
1111
constructor(client, data) {
1212
super(client, data);
1313

14+
/**
15+
* An array of the selected channel ids
16+
* @type {Snowflake[]}
17+
*/
18+
this.values = data.data.values ?? [];
19+
1420
/**
1521
* Collection of the selected channels
1622
* @type {Collection<Snowflake, Channel|APIChannel>}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction {
1212
constructor(client, data) {
1313
super(client, data);
1414

15+
/**
16+
* An array of the selected user and role ids
17+
* @type {Snowflake[]}
18+
*/
19+
this.values = data.data.values ?? [];
20+
1521
const { members, users, roles } = data.data.resolved ?? {};
1622

1723
/**

packages/discord.js/src/structures/RoleSelectMenuInteraction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ class RoleSelectMenuInteraction extends MessageComponentInteraction {
1111
constructor(client, data) {
1212
super(client, data);
1313

14+
/**
15+
* An array of the selected role ids
16+
* @type {Snowflake[]}
17+
*/
18+
this.values = data.data.values ?? [];
19+
1420
/**
1521
* Collection of the selected roles
1622
* @type {Collection<Snowflake, Role|APIRole>}

packages/discord.js/src/structures/UserSelectMenuInteraction.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class UserSelectMenuInteraction extends MessageComponentInteraction {
1212
constructor(client, data) {
1313
super(client, data);
1414

15+
/**
16+
* An array of the selected user ids
17+
* @type {Snowflake[]}
18+
*/
19+
this.values = data.data.values ?? [];
20+
1521
/**
1622
* Collection of the selected users
1723
* @type {Collection<Snowflake, User>}

packages/discord.js/typings/index.d.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,8 +2371,12 @@ export class UserSelectMenuInteraction<
23712371
UserSelectMenuComponent | APIUserSelectComponent
23722372
>;
23732373
public componentType: ComponentType.UserSelect;
2374+
public values: Snowflake[];
23742375
public users: Collection<Snowflake, User>;
2375-
public members: Collection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIGuildMember>>;
2376+
public members: Collection<
2377+
Snowflake,
2378+
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
2379+
>;
23762380
public inGuild(): this is UserSelectMenuInteraction<'raw' | 'cached'>;
23772381
public inCachedGuild(): this is UserSelectMenuInteraction<'cached'>;
23782382
public inRawGuild(): this is UserSelectMenuInteraction<'raw'>;
@@ -2390,7 +2394,8 @@ export class RoleSelectMenuInteraction<
23902394
RoleSelectMenuComponent | APIRoleSelectComponent
23912395
>;
23922396
public componentType: ComponentType.RoleSelect;
2393-
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
2397+
public values: Snowflake[];
2398+
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
23942399
public inGuild(): this is RoleSelectMenuInteraction<'raw' | 'cached'>;
23952400
public inCachedGuild(): this is RoleSelectMenuInteraction<'cached'>;
23962401
public inRawGuild(): this is RoleSelectMenuInteraction<'raw'>;
@@ -2408,9 +2413,13 @@ export class MentionableSelectMenuInteraction<
24082413
MentionableSelectMenuComponent | APIMentionableSelectComponent
24092414
>;
24102415
public componentType: ComponentType.MentionableSelect;
2416+
public values: Snowflake[];
24112417
public users: Collection<Snowflake, User>;
2412-
public members: Collection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIGuildMember>>;
2413-
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
2418+
public members: Collection<
2419+
Snowflake,
2420+
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
2421+
>;
2422+
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
24142423
public inGuild(): this is MentionableSelectMenuInteraction<'raw' | 'cached'>;
24152424
public inCachedGuild(): this is MentionableSelectMenuInteraction<'cached'>;
24162425
public inRawGuild(): this is MentionableSelectMenuInteraction<'raw'>;
@@ -2428,7 +2437,11 @@ export class ChannelSelectMenuInteraction<
24282437
ChannelSelectMenuComponent | APIChannelSelectComponent
24292438
>;
24302439
public componentType: ComponentType.ChannelSelect;
2431-
public channels: Collection<Snowflake, CacheTypeReducer<Cached, Channel, APIChannel>>;
2440+
public values: Snowflake[];
2441+
public channels: Collection<
2442+
Snowflake,
2443+
CacheTypeReducer<Cached, Channel, APIChannel, Channel | APIChannel, Channel | APIChannel>
2444+
>;
24322445
public inGuild(): this is ChannelSelectMenuInteraction<'raw' | 'cached'>;
24332446
public inCachedGuild(): this is ChannelSelectMenuInteraction<'cached'>;
24342447
public inRawGuild(): this is ChannelSelectMenuInteraction<'raw'>;

0 commit comments

Comments
 (0)