From 99bc8fb6b831dce4e99f621b744fd8dfebad1924 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Mon, 6 Dec 2021 23:58:36 +0000 Subject: [PATCH] fix: autocomplete choices --- src/helpers/interactions/sendInteractionResponse.ts | 2 +- .../interactions/commands/applicationCommandCallbackData.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers/interactions/sendInteractionResponse.ts b/src/helpers/interactions/sendInteractionResponse.ts index 05deb79f6..4ea482fa9 100644 --- a/src/helpers/interactions/sendInteractionResponse.ts +++ b/src/helpers/interactions/sendInteractionResponse.ts @@ -142,6 +142,7 @@ export async function sendInteractionResponse( }), })), flags: options.data.flags, + choices: options.data.choices, }; // A reply has never been send @@ -150,7 +151,6 @@ export async function sendInteractionResponse( type: options.type, data, }); - } // If its already been executed, we need to send a followup response diff --git a/src/types/interactions/commands/applicationCommandCallbackData.ts b/src/types/interactions/commands/applicationCommandCallbackData.ts index b604376e1..e19621e2d 100644 --- a/src/types/interactions/commands/applicationCommandCallbackData.ts +++ b/src/types/interactions/commands/applicationCommandCallbackData.ts @@ -3,6 +3,7 @@ import { Embed } from "../../embeds/embed.ts"; import { AllowedMentions } from "../../messages/allowedMentions.ts"; import { MessageComponents } from "../../messages/components/messageComponents.ts"; import { CreateMessage } from "../../messages/createMessage.ts"; +import { ApplicationCommandOptionChoice } from "./applicationCommandOptionChoice.ts"; /** https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionapplicationcommandcallbackdata */ export interface InteractionApplicationCommandCallbackData { @@ -29,4 +30,6 @@ export interface InteractionApplicationCommandCallbackData { components?: MessageComponents; /** Set to `64` to make your response ephemeral */ flags?: number; + /** autocomplete choices (max of 25 choices) */ + choices?: ApplicationCommandOptionChoice[]; }