InteractionsAPI

export declare class InteractionsAPI
export declare class InteractionsAPI

No summary provided.

constructor(rest, webhooks)
Constructs a new instance of the InteractionsAPI class
NameTypeOptionalDescription
restRESTNoNone
webhooksWebhooksAPINoNone
createAutocompleteResponse(interactionId, interactionToken, callbackData, options?):Promise<APICommandAutocompleteInteractionResponseCallbackData>
Sends an autocomplete response to an interaction and returns an interaction callback object
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
callbackDataAPICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { with_response: true; }NoThe callback data for the autocomplete response
optionsPick<RequestData, 'signal'>YesThe 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
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
callbackDataAPIModalInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { with_response: true; }NoThe modal callback data to send
optionsPick<RequestData, 'signal'>YesThe options for sending the modal
defer(interactionId, interactionToken, body, options?):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Defers the reply to an interaction and returns an interaction callback object
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
bodyAPIInteractionResponseDeferredChannelMessageWithSource['data'] & RESTPostAPIInteractionCallbackQuery & { with_response: true; }NoThe callback data for deferring the reply
optionsPick<RequestData, 'signal'>YesThe options for deferring
deferMessageUpdate(interactionId, interactionToken, body, options?):Promise<undefined>
Defers an update from a message component interaction and returns an interaction callback object
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
bodyRESTPostAPIInteractionCallbackQuery & { with_response: true; }NoThe callback data for deferring the update
optionsPick<RequestData, 'signal'>YesThe options for deferring
deleteReply(applicationId, interactionToken, messageId?, options?):Promise<void>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the interaction
interactionTokenstringNoThe token of the interaction
messageIdSnowflake | '@original'YesThe id of the message to delete. If omitted, the original reply will be deleted
optionsPick<RequestData, 'signal'>YesThe options for deleting the reply
editReply(applicationId, interactionToken, callbackData, messageId?, options?):Promise<APIMessage>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the interaction
interactionTokenstringNoThe token of the interaction
callbackDataAPIInteractionResponseCallbackData & { files?: RawFile[]; }NoThe callback data for editing the reply
messageIdSnowflake | '@original'YesThe id of the message to edit. If omitted, the original reply will be edited
optionsPick<RequestData, 'signal'>YesThe options for editing the reply
followUp(applicationId, interactionToken, body, options?):Promise<APIMessage>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the interaction
interactionTokenstringNoThe token of the interaction
bodyAPIInteractionResponseCallbackData & { files?: RawFile[]; }NoThe callback data for replying
optionsPick<RequestData, 'signal'>YesThe options for replying
getOriginalReply(applicationId, interactionToken, options?):Promise<APIMessage>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the interaction
interactionTokenstringNoThe token of the interaction
optionsPick<RequestData, 'signal'>YesThe options for fetching the reply
reply(interactionId, interactionToken, body, options?):Promise<RESTPostAPIInteractionCallbackWithResponseResult>
Replies to an interaction and returns an interaction callback object
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
bodyAPIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { files?: RawFile[]; with_response: true; }NoThe callback data for replying
optionsPick<RequestData, 'signal'>YesThe options for replying
Deprecated
sendPremiumRequired(interactionId, interactionToken, options?):Promise<void>
Sending a premium-style button is the new Discord behaviour.
Deprecated
Sends a premium required response to an interaction
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
optionsPick<RequestData, 'signal'>YesThe 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
NameTypeOptionalDescription
interactionIdSnowflakeNoThe id of the interaction
interactionTokenstringNoThe token of the interaction
callbackDataAPIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { files?: RawFile[]; with_response: true; }NoThe callback data for updating the interaction
optionsPick<RequestData, 'signal'>NoThe options for updating the interaction