AutocompleteInteraction
classe · Source
Represents an autocomplete interaction.
Extends: Interaction
Properties
channelId
The id of the channel this interaction was sent in Source
commandId
The invoked application command's id Source
commandName
The invoked application command's name Source
responded
Whether this interaction has already received a response Source
options
The options passed to the command Source
command
The invoked application command, if it was fetched before Source
type
The interaction's type Source
id
The interaction's id Source
token
The interaction's token Source
applicationId
The application's id Source
guildId
The id of the guild this interaction was sent in Source
user
The user which sent this interaction Source
member
If this interaction was sent in a guild, the member which sent it Source
version
The version Source
appPermissions
Set of permissions the application or bot has within the channel the interaction was sent from Source
memberPermissions
The permissions of the member, if one exists, in the channel this interaction was executed in Source
locale
The locale of the user who invoked this interaction Source
guildLocale
The preferred locale from the guild this interaction was sent in Source
authorizingIntegrationOwners
Owners for each installation context that authorized this interaction. Source
createdTimestamp
The timestamp the interaction was created at Source
createdAt
The time the interaction was created at Source
channel
The channel this interaction was sent in Source
guild
The guild this interaction was sent in Source
client
The client that instantiated this Source
Methods
transformOption
Transforms an option received from the API. Parameters
| Name | Type | Description |
|---|---|---|
option | APIApplicationCommandOption | The received option |
Returns: CommandInteractionOptionSource
respond
Sends results for the autocomplete of this interaction. Parameters
| Name | Type | Description |
|---|---|---|
options | Array<ApplicationCommandOptionChoiceData> | The options for the autocomplete |
Returns: Promise<void>
// respond to autocomplete interaction
interaction.respond([
{
name: 'Option 1',
value: 'option1',
},
])
.then(console.log)
.catch(console.error);inGuild
Indicates whether this interaction is received from a guild. Returns: booleanSource
inCachedGuild
Indicates whether or not this interaction is both cached and received from a guild. Returns: booleanSource
inRawGuild
Indicates whether or not this interaction is received from an uncached guild. Returns: booleanSource
isApplicationCommand
Indicates whether this interaction is a BaseCommandInteraction. Returns: booleanSource
isCommand
Indicates whether this interaction is a CommandInteraction. Returns: booleanSource
isContextMenu
Indicates whether this interaction is a ContextMenuInteractionReturns: booleanSource
isModalSubmit
Indicates whether this interaction is a ModalSubmitInteractionReturns: booleanSource
isUserContextMenu
Indicates whether this interaction is a UserContextMenuInteractionReturns: booleanSource
isMessageContextMenu
Indicates whether this interaction is a MessageContextMenuInteractionReturns: booleanSource
isAutocomplete
Indicates whether this interaction is an AutocompleteInteractionReturns: booleanSource
isMessageComponent
Indicates whether this interaction is a MessageComponentInteraction. Returns: booleanSource
isButton
Indicates whether this interaction is a ButtonInteraction. Returns: booleanSource
isSelectMenu
Indicates whether this interaction is a SelectMenuInteraction. Returns: booleanSource
isRepliable
Indicates whether this interaction can be replied to. Returns: booleanSource