types(interactions): fix overloads (#10702)

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Naiyar
2025-01-19 01:19:41 +06:00
committed by Jiralite
parent d4b0f4de5f
commit d4d326b70d

View File

@@ -74,6 +74,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async reply(
interactionId: Snowflake,
interactionToken: string,
@@ -126,6 +142,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async defer(
interactionId: Snowflake,
interactionToken: string,
@@ -177,6 +209,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async deferMessageUpdate(
interactionId: Snowflake,
interactionToken: string,
@@ -309,6 +357,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async updateMessage(
interactionId: Snowflake,
interactionToken: string,
@@ -361,6 +425,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async createAutocompleteResponse(
interactionId: Snowflake,
interactionToken: string,
@@ -412,6 +492,22 @@ export class InteractionsAPI {
options?: Pick<RequestData, 'signal'>,
): Promise<undefined>;
/**
* 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<RequestData, 'signal'>,
): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
public async createModal(
interactionId: Snowflake,
interactionToken: string,