class InteractionsAPI

export declare class InteractionsAPI

Constructors

constructor(
rest: REST
webhooks: WebhooksAPI
)

Constructs a new instance of the InteractionsAPI class

createAutocompleteResponse(
interactionId: Snowflake
interactionToken: string
callbackData: CreateAutocompleteResponseOptions & { with_response: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Sends an autocomplete response to an interaction and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

createModal(
interactionId: Snowflake
interactionToken: string
callbackData: CreateModalResponseOptions & { with_response: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Sends a modal response to an interaction and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

defer(
interactionId: Snowflake
interactionToken: string
body: CreateInteractionDeferResponseOptions & { with_response: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Defers the reply to an interaction and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

deferMessageUpdate(
interactionId: Snowflake
interactionToken: string
body: RESTPostAPIInteractionCallbackQuery & { with_response: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Defers an update from a message component interaction and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

getOriginalReply(
applicationId: Snowflake
interactionToken: string
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Fetches the initial reply to an interaction

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response

reply(
interactionId: Snowflake
interactionToken: string
body: CreateInteractionResponseOptions & { with_response: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Replies to an interaction and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

updateMessage(
interactionId: Snowflake
interactionToken: string
callbackData: CreateInteractionUpdateMessageResponseOptions & { with_response: true; }
options: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIInteractionCallbackWithResponseResult>

Updates the message the component interaction was triggered on and returns an interaction callback object

See also: https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response