From 6f05c96ab4ae64c2bbe261dc50ddfc44e1783a97 Mon Sep 17 00:00:00 2001 From: Naiyar <137700126+imnaiyar@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:10:35 +0530 Subject: [PATCH] fix(interactions): wrong return type and missing implementation of with_response in core (#10644) * fix(types): wrong return type with with_response * fix: missing implementation of with_response --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/core/src/api/interactions.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/api/interactions.ts b/packages/core/src/api/interactions.ts index 7bc52cc29..2ebe5f668 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -150,7 +150,7 @@ export class InteractionsAPI { interactionToken: string, body: RESTPostAPIInteractionCallbackQuery & { with_response: true }, options?: Pick, - ): Promise; + ): Promise; /** * Defers an update from a message component interaction @@ -166,7 +166,7 @@ export class InteractionsAPI { interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery & { with_response?: false }, options?: Pick, - ): Promise; + ): Promise; public async deferMessageUpdate( interactionId: Snowflake, @@ -313,6 +313,7 @@ export class InteractionsAPI { { signal }: Pick = {}, ) { const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { + query: makeURLSearchParams({ with_response }), files, auth: false, body: { @@ -340,7 +341,7 @@ export class InteractionsAPI { callbackData: APICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & { with_response: true }, options?: Pick, - ): Promise; + ): Promise; /** * Sends an autocomplete response to an interaction @@ -369,6 +370,7 @@ export class InteractionsAPI { { signal }: Pick = {}, ) { const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { + query: makeURLSearchParams({ with_response }), auth: false, body: { type: InteractionResponseType.ApplicationCommandAutocompleteResult, @@ -421,6 +423,7 @@ export class InteractionsAPI { { signal }: Pick = {}, ) { const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { + query: makeURLSearchParams({ with_response }), auth: false, body: { type: InteractionResponseType.Modal,