AutocompleteInteraction

export class AutocompleteInteraction<Cached extends CacheType = CacheType> extends BaseInteraction<Cached>
export class AutocompleteInteraction<Cached extends CacheType = CacheType> extends BaseInteraction<Cached>
Represents an autocomplete interaction.

Extends

BaseInteraction<Cached>
NameConstraintsOptionalDefaultDescription
CachedCacheTypeYesCacheTypeNone
applicationId:Snowflake
The application's id
appPermissions?:Readonly<PermissionsBitField>
Set of permissions the application or bot has within the channel the interaction was sent from
Readonly
The channel this interaction was sent in
channelId:Snowflake
The id of the channel this interaction was sent in
Readonly
client:Client
The client that instantiated this
The invoked application command, if it was fetched before
commandGuildId:Snowflake | null
The id of the guild the invoked application command is registered to
commandId:Snowflake
The invoked application command's id
commandName:string
The invoked application command's name
The invoked application command's type
Readonly
createdAt:Date
The time the interaction was created at
Readonly
createdTimestamp:number
The timestamp the interaction was created at
Readonly
guild?:Guild
The guild this interaction was sent in
guildId?:Snowflake
The id of the guild this interaction was sent in
guildLocale?:Locale
The preferred locale from the guild this interaction was sent in
The interaction's id
locale:Locale
The locale of the user who invoked this interaction
If this interaction was sent in a guild, the member which sent it
memberPermissions?:Readonly<PermissionsBitField>
The permissions of the member, if one exists, in the channel this interaction was executed in
options:Omit< CommandInteractionOptionResolver<Cached>, 'getMessage' | 'getUser' | 'getAttachment' | 'getChannel' | 'getMember' | 'getMentionable' | 'getRole' >
The options passed to the command
responded:boolean
Whether this interaction has already received a response
Readonly
token:string
The interaction's token
user:User
The user who created this interaction
version:number
The version
inCachedGuild():this is AutocompleteInteraction<'cached'>
Indicates whether or not this interaction is both cached and received from a guild.
inGuild():this is AutocompleteInteraction<'raw' | 'cached'>
Indicates whether this interaction is received from a guild.
inRawGuild():this is AutocompleteInteraction<'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.
Deprecated
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
respond(options):Promise<void>
Sends results for the autocomplete of this interaction.
Example
// respond to autocomplete interaction
interaction.respond([
{
name: 'Option 1',
value: 'option1',
},
])
.then(() => console.log('Successfully responded to the autocomplete interaction'))
.catch(console.error);
// respond to autocomplete interaction
interaction.respond([
{
name: 'Option 1',
value: 'option1',
},
])
.then(() => console.log('Successfully responded to the autocomplete interaction'))
.catch(console.error);
NameTypeOptionalDescription
optionsApplicationCommandOptionChoiceData[]NoThe options for the autocomplete
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
valueOf():string