From 1cfc835e97fe1679a822299a8f9fce70ebbaeeeb 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 bc485a762..2b680dd10 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -159,7 +159,7 @@ export class InteractionsAPI { interactionToken: string, body: RESTPostAPIInteractionCallbackQuery & { with_response: true }, options?: Pick, - ): Promise; + ): Promise; /** * Defers an update from a message component interaction @@ -175,7 +175,7 @@ export class InteractionsAPI { interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery & { with_response?: false }, options?: Pick, - ): Promise; + ): Promise; public async deferMessageUpdate( interactionId: Snowflake, @@ -316,6 +316,7 @@ export class InteractionsAPI { { signal }: Pick = {}, ) { const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { + query: makeURLSearchParams({ with_response }), files, auth: false, body: { @@ -342,7 +343,7 @@ export class InteractionsAPI { interactionToken: string, callbackData: CreateAutocompleteResponseOptions & { with_response: true }, options?: Pick, - ): Promise; + ): Promise; /** * Sends an autocomplete response to an interaction @@ -367,6 +368,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, @@ -417,6 +419,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,