class UserSelectMenuInteraction
extends
MessageComponentInteraction<Cached>export class UserSelectMenuInteraction< Cached extends CacheType = CacheType,> extends MessageComponentInteraction<Cached>
Represents a ComponentType.UserSelect select menu interaction.
Constructors
client: Client<true>)
constructor(Constructs a new instance of the UserSelectMenuInteraction
class
Snowflake applicationId :
The application's id
optionalReadonly<PermissionsBitField> appPermissions? :
Set of permissions the application or bot has within the channel the interaction was sent from
readonlyoptionalTextBasedChannels channel? :
The channel this interaction was sent in
Snowflake channelId :
The id of the channel this interaction was sent in
readonlyClient client :
The client that instantiated this
readonlyCacheTypeReducer< Cached, UserSelectMenuComponent, APIUserSelectComponent, UserSelectMenuComponent | APIUserSelectComponent, UserSelectMenuComponent | APIUserSelectComponent > component :
The component which was interacted with
ComponentType.UserSelect componentType :
The type of component which was interacted with
readonlyDate createdAt :
The time the interaction was created at
readonlynumber createdTimestamp :
The timestamp the interaction was created at
string customId :
The custom id of the component which was interacted with
boolean deferred :
Whether the reply to this interaction has been deferred
optionalboolean ephemeral? :
Whether the reply to this interaction is ephemeral
readonlyoptionalGuild guild? :
The guild this interaction was sent in
optionalSnowflake guildId? :
The id of the guild this interaction was sent in
optionalLocale guildLocale? :
The preferred locale from the guild this interaction was sent in
Snowflake id :
The interaction's id
Locale locale :
The locale of the user who invoked this interaction
optionalGuildMember | APIGuildMember member? :
If this interaction was sent in a guild, the member which sent it
optionalReadonly<PermissionsBitField> memberPermissions? :
The permissions of the member, if one exists, in the channel this interaction was executed in
Collection< Snowflake, CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember> > members :
Collection of the selected members
Message message :
The message to which the component was attached
boolean replied :
Whether this interaction has already been replied to
readonlystring token :
The interaction's token
InteractionType type :
The interaction's type
User user :
The user who created this interaction
Collection<Snowflake, User> users :
Collection of the selected users
Snowflake[] values :
An array of the selected user ids
number version :
The version
InteractionWebhook webhook :
An associated interaction webhook, can be used to further interact with this interaction
awaitModalSubmit) : Promise<ModalSubmitInteraction<Cached>> (
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
// Collect a modal submit interaction
const filter = (interaction) => interaction.customId === 'modal';
interaction.awaitModalSubmit({ filter, time: 15_000 })
.then(interaction => console.log(`${interaction.customId} was submitted!`))
.catch(console.error);
Inherited from: MessageComponentInteraction
deferReplyoptions: InteractionDeferReplyOptions & { fetchReply: true }) : Promise<Message<BooleanCache<Cached>>> (
Defers the reply to this interaction.
// Defer the reply to this interaction
interaction.deferReply()
.then(console.log)
.catch(console.error)
// Defer to send an ephemeral reply later
interaction.deferReply({ ephemeral: true })
.then(console.log)
.catch(console.error);
deferUpdateoptions: InteractionDeferUpdateOptions & { fetchReply: true }) : Promise<Message<BooleanCache<Cached>>> (
Defers an update to the message to which the component was attached.
// Defer updating and reset the component's loading state
interaction.deferUpdate()
.then(console.log)
.catch(console.error);
deleteReplymessage?: MessageResolvable | '@original') : Promise<void> (
Deletes a reply to this interaction.
// Delete the initial reply to this interaction
interaction.deleteReply()
.then(console.log)
.catch(console.error);
Inherited from: MessageComponentInteraction
editReplyoptions: string | MessagePayload | InteractionEditReplyOptions) : Promise<Message<BooleanCache<Cached>>> (
Edits a reply to this interaction.
// Edit the initial reply to this interaction
interaction.editReply('New content')
.then(console.log)
.catch(console.error);
Inherited from: MessageComponentInteraction
fetchReplymessage?: Snowflake | '@original') : Promise<Message<BooleanCache<Cached>>> (
Fetches a reply to this interaction.
// Fetch the initial reply to this interaction
interaction.fetchReply()
.then(reply => console.log(`Replied with ${reply.content}`))
.catch(console.error);
Inherited from: MessageComponentInteraction
followUpoptions: string | MessagePayload | InteractionReplyOptions) : Promise<Message<BooleanCache<Cached>>> (
Send a follow-up message to this interaction.
Inherited from: MessageComponentInteraction
inCachedGuildthis is UserSelectMenuInteraction<'cached'> () :
Indicates whether or not this interaction is both cached and received from a guild.
inGuildthis is UserSelectMenuInteraction<'raw' | 'cached'> () :
Indicates whether this interaction is received from a guild.
inRawGuildthis is UserSelectMenuInteraction<'raw'> () :
Indicates whether or not this interaction is received from an uncached guild.
isAnySelectMenuthis is AnySelectMenuInteraction<Cached> () :
Indicates whether this interaction is a select menu of any known type.
Inherited from: BaseInteraction
isAutocompletethis is AutocompleteInteraction<Cached> () :
Indicates whether this interaction is an AutocompleteInteraction
Inherited from: BaseInteraction
isButtonthis is ButtonInteraction<Cached> () :
Indicates whether this interaction is a ButtonInteraction.
Inherited from: BaseInteraction
isChannelSelectMenuthis is ChannelSelectMenuInteraction<Cached> () :
Indicates whether this interaction is a ChannelSelectMenuInteraction
Inherited from: BaseInteraction
isChatInputCommandthis is ChatInputCommandInteraction<Cached> () :
Indicates whether this interaction is a ChatInputCommandInteraction.
Inherited from: BaseInteraction
isCommandthis is CommandInteraction<Cached> () :
Indicates whether this interaction is a CommandInteraction
Inherited from: BaseInteraction
isContextMenuCommandthis is ContextMenuCommandInteraction<Cached> () :
Indicates whether this interaction is a ContextMenuCommandInteraction
Inherited from: BaseInteraction
isMentionableSelectMenuthis is MentionableSelectMenuInteraction<Cached> () :
Indicates whether this interaction is a MentionableSelectMenuInteraction
Inherited from: BaseInteraction
isMessageComponentthis is MessageComponentInteraction<Cached> () :
Indicates whether this interaction is a MessageComponentInteraction
Inherited from: BaseInteraction
isMessageContextMenuCommandthis is MessageContextMenuCommandInteraction<Cached> () :
Indicates whether this interaction is a MessageContextMenuCommandInteraction
Inherited from: BaseInteraction
isModalSubmitthis is ModalSubmitInteraction<Cached> () :
Indicates whether this interaction is a ModalSubmitInteraction
Inherited from: BaseInteraction
isRepliablethis is RepliableInteraction<Cached> () :
Indicates whether this interaction can be replied to.
Inherited from: BaseInteraction
isRoleSelectMenuthis is RoleSelectMenuInteraction<Cached> () :
Indicates whether this interaction is a RoleSelectMenuInteraction
Inherited from: BaseInteraction
deprecated isSelectMenuthis is StringSelectMenuInteraction<Cached> () :
Use isStringSelectMenu instead.
Indicates whether this interaction is a StringSelectMenuInteraction.
Inherited from: BaseInteraction
isStringSelectMenuthis is StringSelectMenuInteraction<Cached> () :
Indicates whether this interaction is a StringSelectMenuInteraction.
Inherited from: BaseInteraction
isUserContextMenuCommandthis is UserContextMenuCommandInteraction<Cached> () :
Indicates whether this interaction is a UserContextMenuCommandInteraction
Inherited from: BaseInteraction
isUserSelectMenuthis is UserSelectMenuInteraction<Cached> () :
Indicates whether this interaction is a UserSelectMenuInteraction
Inherited from: BaseInteraction
replyoptions: InteractionReplyOptions & { fetchReply: true }) : Promise<Message<BooleanCache<Cached>>> (
Creates a reply to this interaction. Use the fetchReply
option to get the bot's reply message.
// Reply to the interaction and fetch the response
interaction.reply({ content: 'Pong!', fetchReply: true })
.then((message) => console.log(`Reply sent with content ${message.content}`))
.catch(console.error);
// Create an ephemeral reply with an embed
const embed = new EmbedBuilder().setDescription('Pong!');
interaction.reply({ embeds: [embed], ephemeral: true })
.then(() => console.log('Reply sent.'))
.catch(console.error);
updateoptions: InteractionUpdateOptions & { fetchReply: true }) : Promise<Message<BooleanCache<Cached>>> (
Updates the original message of the component on which the interaction was received on.
// Remove the components from the message
interaction.update({
content: "A component interaction was received",
components: []
})
.then(console.log)
.catch(console.error);