InteractionsAPI
declare class InteractionsAPI
declare class InteractionsAPI
No summary provided.
constructor(rest, webhooks)
Constructs a new instance of the
InteractionsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
webhooks | WebhooksAPI | No | None |
createAutocompleteResponse(interactionId, interactionToken, data)
:
Promise<void>
Sends an autocomplete response to an interaction
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
data | APICommandAutocompleteInteractionResponseCallbackData | No | Data for the autocomplete response |
createModal(interactionId, interactionToken, data)
:
Promise<void>
Sends a modal response to an interaction
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
data | APIModalInteractionResponseCallbackData | No | The modal to send |
defer(interactionId, interactionToken)
:
Promise<void>
Defers the reply to an interaction
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
deferMessageUpdate(interactionId, interactionToken)
:
Promise<void>
Defers an update from a message component interaction
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
deleteReply(applicationId, interactionToken)
:
Promise<void>
Deletes the initial reply to an interaction
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the interaction |
interactionToken | string | No | The token of the interaction |
editReply(applicationId, interactionToken, data, messageId?)
:
Promise<discord_api_types_v10.APIMessage>
Edits the initial reply to an interaction
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the interaction |
interactionToken | string | No | The token of the interaction |
data | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | The data to use when editing the reply |
messageId | string | Yes | The id of the message to edit. If omitted, the original reply will be edited |
followUp(applicationId, interactionToken, data)
:
Promise<void>
Reply to a deferred interaction
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the interaction |
interactionToken | string | No | The token of the interaction |
data | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | The data to use when replying |
getOriginalReply(applicationId, interactionToken)
:
Promise<discord_api_types_v10.APIMessage>
Fetches the initial reply to an interaction
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the interaction |
interactionToken | string | No | The token of the interaction |
reply(interactionId, interactionToken, { files, ...data })
:
Promise<void>
Replies to an interaction
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
{ files, ...data } | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | None |
updateMessage(interactionId, interactionToken, { files, ...data })
:
Promise<void>
Updates the the message the component interaction was triggered on
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
{ files, ...data } | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | None |