AutocompleteInteraction
This is the base type interaction, all interaction types extend from this
Extends
BaseInteraction
<APIApplicationCommandAutocompleteInteraction
>
Constructors
Constructor
new AutocompleteInteraction(
__namedParameters
):AutocompleteInteraction
Parameters
Parameter | Type |
---|---|
__namedParameters | { client : Client ; data : APIApplicationCommandAutocompleteInteraction ; defaults : InteractionDefaults ; processingCommand? : Command ; } |
__namedParameters.client | Client |
__namedParameters.data | APIApplicationCommandAutocompleteInteraction |
__namedParameters.defaults | InteractionDefaults |
__namedParameters.processingCommand? | Command |
Returns
AutocompleteInteraction
Overrides
Properties
Property | Type | Default value | Description | Inherited from |
---|---|---|---|---|
_deferred | boolean | false | Internal Whether the interaction is deferred already | BaseInteraction ._deferred |
client | Client | undefined | - | BaseInteraction .client |
options | AutocompleteOptionsHandler | undefined | This is the options of the commands, parsed from the interaction data. | - |
rawData | APIApplicationCommandAutocompleteInteraction | undefined | The raw data of the interaction | BaseInteraction .rawData |
type | InteractionType | undefined | The type of interaction | BaseInteraction .type |
userId | undefined | string | undefined | The user who sent the interaction | BaseInteraction .userId |
Accessors
channel
Get Signature
get channel():
null
|DmChannel
<false
> |GroupDmChannel
<false
> |GuildTextChannel
<false
> |GuildVoiceChannel
<false
> |GuildCategoryChannel
<false
> |GuildAnnouncementChannel
<false
> |GuildThreadChannel
<ThreadChannelType
,false
> |GuildStageChannel
<false
> |GuildForumChannel
<false
> |GuildMediaChannel
Returns
null
| DmChannel
<false
> | GroupDmChannel
<false
> | GuildTextChannel
<false
> | GuildVoiceChannel
<false
> | GuildCategoryChannel
<false
> | GuildAnnouncementChannel
<false
> | GuildThreadChannel
<ThreadChannelType
, false
> | GuildStageChannel
<false
> | GuildForumChannel
<false
> | GuildMediaChannel
Inherited from
embeds
Get Signature
get embeds():
null
|Embed
[]
Returns
null
| Embed
[]
Inherited from
guild
Get Signature
get guild():
null
|Guild
<true
>
Returns
null
| Guild
<true
>
Inherited from
member
Get Signature
get member():
null
|GuildMember
<false
,true
>
Returns
null
| GuildMember
<false
, true
>
Inherited from
message
Get Signature
get message():
null
|Message
<false
>
Returns
null
| Message
<false
>
Inherited from
user
Get Signature
get user():
null
|User
<false
>
Returns
null
| User
<false
>
Inherited from
Methods
defer()
defer():
Promise
<never
>
Internal
Defer the interaction response. This is used automatically by commands that are set to defer. If the interaction is already deferred, this will do nothing.
Returns
Promise
<never
>
Overrides
followUp()
followUp(
reply
):Promise
<void
>
Send a followup message to the interaction
Parameters
Parameter | Type |
---|---|
reply | MessagePayload |
Returns
Promise
<void
>
Inherited from
reply()
reply():
Promise
<never
>
Reply to an interaction. If the interaction is deferred, this will edit the original response.
Returns
Promise
<never
>
Overrides
replyAndWaitForComponent()
replyAndWaitForComponent(
data
,timeout
):Promise
<{customId
:string
;success
:true
;values?
:string
[]; } | {reason
:"timed out"
;success
:false
; }>
This function will reply to the interaction and wait for a component to be pressed. Any components passed in the message will not have run() functions called and will only trigger the interaction.acknowledge() function. This function will also return a promise that resolves to the custom ID of the component that was pressed.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
data | MessagePayload | undefined | The message data to send |
timeout | number | 300000 | After this many milliseconds, the promise will resolve to null |
Returns
Promise
<{ customId
: string
; success
: true
; values?
: string
[]; } | { reason
: "timed out"
; success
: false
; }>
Inherited from
BaseInteraction
.replyAndWaitForComponent
respond()
respond(
choices
):Promise
<void
>
Respond with the choices for an autocomplete interaction
Parameters
Parameter | Type |
---|---|
choices | object [] |
Returns
Promise
<void
>
showModal()
showModal(
modal
):Promise
<void
>
Show a modal to the user This can only be used if the interaction is not deferred
Parameters
Parameter | Type |
---|---|
modal | Modal |
Returns
Promise
<void
>