Skip to content

Commit 1cfc835

Browse files
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>
1 parent b3d4259 commit 1cfc835

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/src/api/interactions.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class InteractionsAPI {
159159
interactionToken: string,
160160
body: RESTPostAPIInteractionCallbackQuery & { with_response: true },
161161
options?: Pick<RequestData, 'signal'>,
162-
): Promise<undefined>;
162+
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
163163

164164
/**
165165
* Defers an update from a message component interaction
@@ -175,7 +175,7 @@ export class InteractionsAPI {
175175
interactionToken: string,
176176
body?: RESTPostAPIInteractionCallbackQuery & { with_response?: false },
177177
options?: Pick<RequestData, 'signal'>,
178-
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
178+
): Promise<undefined>;
179179

180180
public async deferMessageUpdate(
181181
interactionId: Snowflake,
@@ -316,6 +316,7 @@ export class InteractionsAPI {
316316
{ signal }: Pick<RequestData, 'signal'> = {},
317317
) {
318318
const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), {
319+
query: makeURLSearchParams({ with_response }),
319320
files,
320321
auth: false,
321322
body: {
@@ -342,7 +343,7 @@ export class InteractionsAPI {
342343
interactionToken: string,
343344
callbackData: CreateAutocompleteResponseOptions & { with_response: true },
344345
options?: Pick<RequestData, 'signal'>,
345-
): Promise<APICommandAutocompleteInteractionResponseCallbackData>;
346+
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
346347

347348
/**
348349
* Sends an autocomplete response to an interaction
@@ -367,6 +368,7 @@ export class InteractionsAPI {
367368
{ signal }: Pick<RequestData, 'signal'> = {},
368369
) {
369370
const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), {
371+
query: makeURLSearchParams({ with_response }),
370372
auth: false,
371373
body: {
372374
type: InteractionResponseType.ApplicationCommandAutocompleteResult,
@@ -417,6 +419,7 @@ export class InteractionsAPI {
417419
{ signal }: Pick<RequestData, 'signal'> = {},
418420
) {
419421
const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), {
422+
query: makeURLSearchParams({ with_response }),
420423
auth: false,
421424
body: {
422425
type: InteractionResponseType.Modal,

0 commit comments

Comments
 (0)