From eafe7ba96fc6e771579850a8a7de36adade8efdc Mon Sep 17 00:00:00 2001 From: Advaith Date: Sun, 7 Mar 2021 14:06:12 -0800 Subject: [PATCH] feat(APIInteractionResponse, APIInteractionResponseType): update for UI changes (#90) --- v8/payloads/interactions.ts | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/v8/payloads/interactions.ts b/v8/payloads/interactions.ts index 6d90f7bb..7d063ba0 100644 --- a/v8/payloads/interactions.ts +++ b/v8/payloads/interactions.ts @@ -133,16 +133,20 @@ export interface APIApplicationCommandInteractionDataOption { export type APIInteractionResponse = | APIInteractionResponsePong | APIInteractionResponseAcknowledge - | APIInteractionResponseAcknowledgeWithSource | APIInteractionResponseChannelMessage - | APIInteractionResponseChannelMessageWithSource; + | APIInteractionResponseChannelMessageWithSource + | APIInteractionResponseDeferredChannelMessageWithSource; export type APIInteractionResponsePong = InteractionResponsePayload; +/** + * @deprecated Use `APIInteractionResponseDeferredChannelMessageWithSource` instead; will be removed on April 9, 2021 + */ export type APIInteractionResponseAcknowledge = InteractionResponsePayload; -export type APIInteractionResponseAcknowledgeWithSource = InteractionResponsePayload; - +/** + * @deprecated Use `APIInteractionResponseChannelMessageWithSource` instead; will be removed on April 9, 2021 + */ export type APIInteractionResponseChannelMessage = InteractionResponsePayload< APIInteractionResponseType.ChannelMessage, true @@ -153,15 +157,34 @@ export type APIInteractionResponseChannelMessageWithSource = InteractionResponse true >; +export type APIInteractionResponseDeferredChannelMessageWithSource = InteractionResponsePayload; + /** * https://discord.com/developers/docs/interactions/slash-commands#interaction-interactionresponsetype */ export const enum APIInteractionResponseType { + /** + * ACK a `Ping` + */ Pong = 1, + /** + * ACK a command without sending a message, eating the user's input + * @deprecated Use `DeferredChannelMessageWithSource` instead; will be removed on April 9, 2021 + */ Acknowledge, + /** + * Respond with a message, eating the user's input + * @deprecated Use `ChannelMessageWithSource` instead; will be removed on April 9, 2021 + */ ChannelMessage, + /** + * Respond to an interaction with a message + */ ChannelMessageWithSource, - AcknowledgeWithSource, + /** + * ACK an interaction and edit to a response later, the user sees a loading state + */ + DeferredChannelMessageWithSource, } /**