mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-28 06:20:11 +00:00
fix(APIInteractionResponse): data should not always be present (#100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -238,14 +238,19 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource;
|
||||
|
||||
export type APIInteractionResponsePong = InteractionResponsePayload<InteractionResponseType.Pong>;
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export type APIInteractionResponseChannelMessageWithSource = InteractionResponsePayload<
|
||||
InteractionResponseType.ChannelMessageWithSource,
|
||||
true
|
||||
>;
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionApplicationCommandCallbackData;
|
||||
}
|
||||
|
||||
export type APIInteractionResponseDeferredChannelMessageWithSource = InteractionResponsePayload<InteractionResponseType.DeferredChannelMessageWithSource>;
|
||||
export interface APIInteractionResponseDeferredChannelMessageWithSource {
|
||||
type: InteractionResponseType.DeferredChannelMessageWithSource;
|
||||
data?: Pick<APIInteractionApplicationCommandCallbackData, 'flags'>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionresponsetype
|
||||
@@ -295,14 +300,6 @@ export interface APIMessageInteraction {
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface InteractionResponsePayload<T extends InteractionResponseType, D = false> {
|
||||
type: T;
|
||||
data: D extends true ? APIInteractionApplicationCommandCallbackData : never;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -238,14 +238,19 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource;
|
||||
|
||||
export type APIInteractionResponsePong = InteractionResponsePayload<InteractionResponseType.Pong>;
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export type APIInteractionResponseChannelMessageWithSource = InteractionResponsePayload<
|
||||
InteractionResponseType.ChannelMessageWithSource,
|
||||
true
|
||||
>;
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionApplicationCommandCallbackData;
|
||||
}
|
||||
|
||||
export type APIInteractionResponseDeferredChannelMessageWithSource = InteractionResponsePayload<InteractionResponseType.DeferredChannelMessageWithSource>;
|
||||
export interface APIInteractionResponseDeferredChannelMessageWithSource {
|
||||
type: InteractionResponseType.DeferredChannelMessageWithSource;
|
||||
data?: Pick<APIInteractionApplicationCommandCallbackData, 'flags'>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionresponsetype
|
||||
@@ -295,14 +300,6 @@ export interface APIMessageInteraction {
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface InteractionResponsePayload<T extends InteractionResponseType, D = false> {
|
||||
type: T;
|
||||
data: D extends true ? APIInteractionApplicationCommandCallbackData : never;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user