diff --git a/packages/core/src/api/interactions.ts b/packages/core/src/api/interactions.ts index e790de459..56f358315 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -74,6 +74,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Replies to an interaction + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param body - The callback data for replying + * @param options - The options for replying + */ + public async reply( + interactionId: Snowflake, + interactionToken: string, + body: CreateInteractionResponseOptions, + options?: Pick, + ): Promise; + public async reply( interactionId: Snowflake, interactionToken: string, @@ -126,6 +142,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Defers the reply to an interaction + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param body - The callback data for deferring the reply + * @param options - The options for deferring + */ + public async defer( + interactionId: Snowflake, + interactionToken: string, + body?: CreateInteractionDeferResponseOptions, + options?: Pick, + ): Promise; + public async defer( interactionId: Snowflake, interactionToken: string, @@ -177,6 +209,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Defers an update from a message component interaction + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param body - The callback data for deferring the update + * @param options - The options for deferring + */ + public async deferMessageUpdate( + interactionId: Snowflake, + interactionToken: string, + body?: RESTPostAPIInteractionCallbackQuery, + options?: Pick, + ): Promise; + public async deferMessageUpdate( interactionId: Snowflake, interactionToken: string, @@ -309,6 +357,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Updates the message the component interaction was triggered on + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param callbackData - The callback data for updating the interaction + * @param options - The options for updating the interaction + */ + public async updateMessage( + interactionId: Snowflake, + interactionToken: string, + callbackData: CreateInteractionUpdateMessageResponseOptions, + options?: Pick, + ): Promise; + public async updateMessage( interactionId: Snowflake, interactionToken: string, @@ -361,6 +425,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Sends an autocomplete response to an interaction + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param callbackData - The callback data for the autocomplete response + * @param options - The options for sending the autocomplete response + */ + public async createAutocompleteResponse( + interactionId: Snowflake, + interactionToken: string, + callbackData: CreateAutocompleteResponseOptions, + options?: Pick, + ): Promise; + public async createAutocompleteResponse( interactionId: Snowflake, interactionToken: string, @@ -412,6 +492,22 @@ export class InteractionsAPI { options?: Pick, ): Promise; + /** + * Sends a modal response to an interaction + * + * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} + * @param interactionId - The id of the interaction + * @param interactionToken - The token of the interaction + * @param callbackData - The modal callback data to send + * @param options - The options for sending the modal + */ + public async createModal( + interactionId: Snowflake, + interactionToken: string, + callbackData: CreateModalResponseOptions, + options?: Pick, + ): Promise; + public async createModal( interactionId: Snowflake, interactionToken: string,