class StringSelectMenuInteraction
extends
MessageComponentInteraction<Cached>export class StringSelectMenuInteraction<Cached extends CacheType = CacheType,> extends MessageComponentInteraction<Cached>Represents a ComponentType.StringSelect select menu interaction.
Constructors
constructor(client: Client<true>)
Constructs a new instance of the StringSelectMenuInteraction class
appPermissions : Readonly<PermissionsBitField>
Set of permissions the application or bot has within the channel the interaction was sent from
Inherited from: BaseInteraction
authorizingIntegrationOwners : APIAuthorizingIntegrationOwnersMap
Mapping of installation contexts that the interaction was authorized for the related user or guild ids
Inherited from: BaseInteraction
readonlychannel : CacheTypeReducer<Cached, GuildTextBasedChannel | null, GuildTextBasedChannel | null, GuildTextBasedChannel | null, TextBasedChannel | null>
The channel this interaction was sent in
Inherited from: BaseInteraction
channelId : Snowflake
The id of the channel this interaction was sent in
Inherited from: MessageComponentInteraction
readonlycomponent : CacheTypeReducer<Cached, StringSelectMenuComponent, APIStringSelectComponent, StringSelectMenuComponent | APIStringSelectComponent, StringSelectMenuComponent | APIStringSelectComponent>
The component which was interacted with
componentType : ComponentType.StringSelect
The type of component which was interacted with
context : InteractionContextType | null
Context where the interaction was triggered from
Inherited from: BaseInteraction
readonlycreatedTimestamp : number
The timestamp the interaction was created at
Inherited from: BaseInteraction
customId : string
The custom id of the component which was interacted with
Inherited from: MessageComponentInteraction
deferred : boolean
Whether the reply to this interaction has been deferred
Inherited from: MessageComponentInteraction
entitlements : Collection<Snowflake, Entitlement>
The entitlements for the invoking user, representing access to premium SKUs
Inherited from: BaseInteraction
Whether the reply to this interaction is ephemeral
Inherited from: MessageComponentInteraction
readonlyguild : CacheTypeReducer<Cached, Guild, null>
The guild this interaction was sent in
Inherited from: BaseInteraction
guildId : CacheTypeReducer<Cached, Snowflake>
The id of the guild this interaction was sent in
Inherited from: BaseInteraction
guildLocale : CacheTypeReducer<Cached, Locale>
The preferred locale from the guild this interaction was sent in
Inherited from: BaseInteraction
member : CacheTypeReducer<Cached, GuildMember, APIInteractionGuildMember>
If this interaction was sent in a guild, the member which sent it
Inherited from: BaseInteraction
memberPermissions : CacheTypeReducer<Cached, Readonly<PermissionsBitField>>
The permissions of the member, if one exists, in the channel this interaction was executed in
Inherited from: BaseInteraction
message : Message<BooleanCache<Cached>>
The message to which the component was attached
Inherited from: MessageComponentInteraction
replied : boolean
Whether this interaction has already been replied to
Inherited from: MessageComponentInteraction
The interaction's type
Inherited from: MessageComponentInteraction
values : string[]
The values selected
webhook : InteractionWebhook
An associated interaction webhook, can be used to further interact with this interaction
Inherited from: MessageComponentInteraction
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
deferReply(options: InteractionDeferReplyOptions & { withResponse: true }) : Promise<InteractionCallbackResponse>
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({ flags: MessageFlags.Ephemeral })
.then(console.log)
.catch(console.error); deferUpdate(options: InteractionDeferUpdateOptions & { withResponse: true }) : Promise<InteractionCallbackResponse>
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); deleteReply(message?: 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
editReply(options: 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
fetchReply(message?: 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
followUp(options: string | MessagePayload | InteractionReplyOptions) : Promise<Message<BooleanCache<Cached>>>
Send a follow-up message to this interaction.
Inherited from: MessageComponentInteraction
inCachedGuild() : this is StringSelectMenuInteraction<'cached'>
Indicates whether this interaction is received from a cached guild.
inGuild() : this is StringSelectMenuInteraction<'raw' | 'cached'>
Indicates whether this interaction is received from a guild.
inRawGuild() : this is StringSelectMenuInteraction<'raw'>
Indicates whether or not this interaction is received from an uncached guild.
isAnySelectMenu() : this is AnySelectMenuInteraction<Cached>
Indicates whether this interaction is a select menu of any known type.
Inherited from: BaseInteraction
isAutocomplete() : this is AutocompleteInteraction<Cached>
Indicates whether this interaction is an AutocompleteInteraction
Inherited from: BaseInteraction
isButton() : this is ButtonInteraction<Cached>
Indicates whether this interaction is a ButtonInteraction.
Inherited from: BaseInteraction
isChannelSelectMenu() : this is ChannelSelectMenuInteraction<Cached>
Indicates whether this interaction is a ChannelSelectMenuInteraction
Inherited from: BaseInteraction
isChatInputCommand() : this is ChatInputCommandInteraction<Cached>
Indicates whether this interaction is a ChatInputCommandInteraction.
Inherited from: BaseInteraction
isCommand() : this is CommandInteraction<Cached>
Indicates whether this interaction is a CommandInteraction
Inherited from: BaseInteraction
isContextMenuCommand() : this is ContextMenuCommandInteraction<Cached>
Indicates whether this interaction is a ContextMenuCommandInteraction
Inherited from: BaseInteraction
isMentionableSelectMenu() : this is MentionableSelectMenuInteraction<Cached>
Indicates whether this interaction is a MentionableSelectMenuInteraction
Inherited from: BaseInteraction
isMessageComponent() : this is MessageComponentInteraction<Cached>
Indicates whether this interaction is a MessageComponentInteraction
Inherited from: BaseInteraction
isMessageContextMenuCommand() : this is MessageContextMenuCommandInteraction<Cached>
Indicates whether this interaction is a MessageContextMenuCommandInteraction
Inherited from: BaseInteraction
isModalSubmit() : this is ModalSubmitInteraction<Cached>
Indicates whether this interaction is a ModalSubmitInteraction
Inherited from: BaseInteraction
isRepliable() : this is RepliableInteraction<Cached>
Indicates whether this interaction can be replied to.
Inherited from: BaseInteraction
isRoleSelectMenu() : this is RoleSelectMenuInteraction<Cached>
Indicates whether this interaction is a RoleSelectMenuInteraction
Inherited from: BaseInteraction
deprecated isSelectMenu() : this is StringSelectMenuInteraction<Cached>
Use isStringSelectMenu instead.
Indicates whether this interaction is a StringSelectMenuInteraction.
Inherited from: BaseInteraction
isStringSelectMenu() : this is StringSelectMenuInteraction<Cached>
Indicates whether this interaction is a StringSelectMenuInteraction.
Inherited from: BaseInteraction
isUserContextMenuCommand() : this is UserContextMenuCommandInteraction<Cached>
Indicates whether this interaction is a UserContextMenuCommandInteraction
Inherited from: BaseInteraction
isUserSelectMenu() : this is UserSelectMenuInteraction<Cached>
Indicates whether this interaction is a UserSelectMenuInteraction
Inherited from: BaseInteraction
reply(options: InteractionReplyOptions & { withResponse: true }) : Promise<InteractionCallbackResponse>
Creates a reply to this interaction. Use the withResponse option to get the interaction callback response.
// Reply to the interaction and fetch the response
interaction.reply({ content: 'Pong!', withResponse: true })
.then((response) => console.log(`Reply sent with content ${response.resource.message.content}`))
.catch(console.error);// Create an ephemeral reply with an embed
const embed = new EmbedBuilder().setDescription('Pong!');
interaction.reply({ embeds: [embed], flags: MessageFlags.Ephemeral })
.then(() => console.log('Reply sent.'))
.catch(console.error);Sending a premium-style button is the new Discord behaviour.
Responds to the interaction with an upgrade button. Only available for applications with monetization enabled.
Inherited from: MessageComponentInteraction
showModal(modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalComponentData | APIModalInteractionResponseCallbackDataoptions: ShowModalOptions & { withResponse: true }) : Promise<InteractionCallbackResponse>
Shows a modal component
update(options: InteractionUpdateOptions & { withResponse: true }) : Promise<InteractionCallbackResponse>
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);