mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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>
This commit is contained in:
@@ -150,7 +150,7 @@ export class InteractionsAPI {
|
||||
interactionToken: string,
|
||||
body: RESTPostAPIInteractionCallbackQuery & { with_response: true },
|
||||
options?: Pick<RequestData, 'signal'>,
|
||||
): Promise<undefined>;
|
||||
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
||||
|
||||
/**
|
||||
* Defers an update from a message component interaction
|
||||
@@ -166,7 +166,7 @@ export class InteractionsAPI {
|
||||
interactionToken: string,
|
||||
body?: RESTPostAPIInteractionCallbackQuery & { with_response?: false },
|
||||
options?: Pick<RequestData, 'signal'>,
|
||||
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
||||
): Promise<undefined>;
|
||||
|
||||
public async deferMessageUpdate(
|
||||
interactionId: Snowflake,
|
||||
@@ -313,6 +313,7 @@ export class InteractionsAPI {
|
||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||
) {
|
||||
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<RequestData, 'signal'>,
|
||||
): Promise<APICommandAutocompleteInteractionResponseCallbackData>;
|
||||
): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
||||
|
||||
/**
|
||||
* Sends an autocomplete response to an interaction
|
||||
@@ -369,6 +370,7 @@ export class InteractionsAPI {
|
||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||
) {
|
||||
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<RequestData, 'signal'> = {},
|
||||
) {
|
||||
const response = await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), {
|
||||
query: makeURLSearchParams({ with_response }),
|
||||
auth: false,
|
||||
body: {
|
||||
type: InteractionResponseType.Modal,
|
||||
|
||||
Reference in New Issue
Block a user