AutocompleteInteraction

AutocompleteInteraction

Represents an application command autocomplete interaction. See Interaction for more properties.

Constructor

new AutocompleteInteraction()

Properties:
Properties
Name Type Attributes Description
appPermissions Permission <nullable>

The permissions the app or bot has within the channel the interaction was sent from

channel DMChannel | TextChannel | NewsChannel

The channel the interaction was created in. Can be partial with only the id if the channel is not cached

data Object

The data attached to the interaction

Name Type Attributes Description
id String

The ID of the Application Command

name String

The command name

options Array.<Object> <nullable>

The run Application Command options

options[].focused Boolean <nullable>

Whether or not the option is focused

options[].name String

The name of the Application Command option

options[].options Array.<Object> <nullable>

The run Application Command options (Mutually exclusive with value)

options[].type Number

Command option type, 1-10

options[].value String | Number | Boolean <nullable>

The value of the run Application Command (Mutually exclusive with options)

target_id String <nullable>

The ID the of user or message targetted by a context menu command

type Number

The command type

guildID String <nullable>

The ID of the guild in which the interaction was created

member Member <nullable>

The member who triggered the interaction (This is only sent when the interaction is invoked within a guild)

user User <nullable>

The user who triggered the interaction (This is only sent when the interaction is invoked within a dm)

Source:

Extends

Methods

(async) acknowledge(choices) → {Promise}

Acknowledges the autocomplete interaction with a result of choices Note: You can not use more than 1 initial interaction response per interaction

Source:
Parameters:
Name Type Description
choices Array.<Object>

The autocomplete choices to return to the user

Name Type Description
name String | Number

The choice display name

value String

The choice value to return to the bot

Returns:
Type:
Promise

(async) result(choices) → {Promise}

Acknowledges the autocomplete interaction with a result of choices Note: You can not use more than 1 initial interaction response per interaction.

Source:
Parameters:
Name Type Description
choices Array.<Object>

The autocomplete choices to return to the user

Name Type Description
name String | Number

The choice display name

value String

The choice value to return to the bot

Returns:
Type:
Promise