Skip to content

Commit

Permalink
feat(APIInteractionResponse, APIInteractionResponseType): update for …
Browse files Browse the repository at this point in the history
…UI changes (#90)
  • Loading branch information
advaith1 committed Mar 7, 2021
1 parent ff76175 commit eafe7ba
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions v8/payloads/interactions.ts
Expand Up @@ -133,16 +133,20 @@ export interface APIApplicationCommandInteractionDataOption {
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIInteractionResponseAcknowledge
| APIInteractionResponseAcknowledgeWithSource
| APIInteractionResponseChannelMessage
| APIInteractionResponseChannelMessageWithSource;
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource;

export type APIInteractionResponsePong = InteractionResponsePayload<APIInteractionResponseType.Pong>;

/**
* @deprecated Use `APIInteractionResponseDeferredChannelMessageWithSource` instead; will be removed on April 9, 2021
*/
export type APIInteractionResponseAcknowledge = InteractionResponsePayload<APIInteractionResponseType.Acknowledge>;

export type APIInteractionResponseAcknowledgeWithSource = InteractionResponsePayload<APIInteractionResponseType.AcknowledgeWithSource>;

/**
* @deprecated Use `APIInteractionResponseChannelMessageWithSource` instead; will be removed on April 9, 2021
*/
export type APIInteractionResponseChannelMessage = InteractionResponsePayload<
APIInteractionResponseType.ChannelMessage,
true
Expand All @@ -153,15 +157,34 @@ export type APIInteractionResponseChannelMessageWithSource = InteractionResponse
true
>;

export type APIInteractionResponseDeferredChannelMessageWithSource = InteractionResponsePayload<APIInteractionResponseType.DeferredChannelMessageWithSource>;

/**
* 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,
}

/**
Expand Down

0 comments on commit eafe7ba

Please sign in to comment.