No summary provided.
Constructs a new instance of the
InteractionsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
webhooks | WebhooksAPI | No | None |
createAutocompleteResponse(interactionId, interactionToken, callbackData, options?):Promise<APICommandAutocompleteInteractionResponseCallbackData>
Sends an autocomplete response to an interaction and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
callbackData | APICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { with_response: true; } | No | The callback data for the autocomplete response |
options | Pick<RequestData, 'signal'> | Yes | The options for sending the autocomplete response |
createModal(interactionId, interactionToken, callbackData, options?):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Sends a modal response to an interaction and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
callbackData | APIModalInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { with_response: true; } | No | The modal callback data to send |
options | Pick<RequestData, 'signal'> | Yes | The options for sending the modal |
defer(interactionId, interactionToken, body, options?):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Defers the reply to an interaction and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
body | APIInteractionResponseDeferredChannelMessageWithSource['data'] & RESTPostAPIInteractionCallbackQuery & { with_response: true; } | No | The callback data for deferring the reply |
options | Pick<RequestData, 'signal'> | Yes | The options for deferring |
Defers an update from a message component interaction and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
body | RESTPostAPIInteractionCallbackQuery & { with_response: true; } | No | The callback data for deferring the update |
options | Pick<RequestData, 'signal'> | Yes | The options for deferring |
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 |
messageId | Snowflake | '@original' | Yes | The id of the message to delete. If omitted, the original reply will be deleted |
options | Pick<RequestData, 'signal'> | Yes | The options for deleting the reply |
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 |
callbackData | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | The callback data for editing the reply |
messageId | Snowflake | '@original' | Yes | The id of the message to edit. If omitted, the original reply will be edited |
options | Pick<RequestData, 'signal'> | Yes | The options for editing the reply |
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 |
body | APIInteractionResponseCallbackData & { files?: RawFile[]; } | No | The callback data for replying |
options | Pick<RequestData, 'signal'> | Yes | The options for replying |
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 |
options | Pick<RequestData, 'signal'> | Yes | The options for fetching the reply |
reply(interactionId, interactionToken, body, options?):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Replies to an interaction and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
body | APIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { files?: RawFile[]; with_response: true; } | No | The callback data for replying |
options | Pick<RequestData, 'signal'> | Yes | The options for replying |
Sending a premium-style button is the new Discord behaviour.
Deprecated
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
options | Pick<RequestData, 'signal'> | Yes | The options for sending the premium required response |
updateMessage(interactionId, interactionToken, callbackData, options):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Updates the message the component interaction was triggered on and returns an interaction callback object
Name | Type | Optional | Description |
---|---|---|---|
interactionId | Snowflake | No | The id of the interaction |
interactionToken | string | No | The token of the interaction |
callbackData | APIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { files?: RawFile[]; with_response: true; } | No | The callback data for updating the interaction |
options | Pick<RequestData, 'signal'> | No | The options for updating the interaction |