Compare commits

..

4 Commits

Author SHA1 Message Date
Vlad Frangu
fc4b7e2708 chore: release 0.13.2 (#103) 2021-03-28 12:56:01 +03:00
Tiemen
15c171c558 fix(ApplicationCommandInteractionDataOptionSubCommandGroup): typo (#102)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-28 12:48:01 +03:00
Vlad Frangu
ebd5754242 chore: release 0.13.1 (#101) 2021-03-28 00:43:10 +02:00
Advaith
ffcd95d597 fix(APIInteractionResponse): data should not always be present (#100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-28 00:40:52 +02:00
4 changed files with 27 additions and 33 deletions

View File

@@ -188,7 +188,7 @@ export interface ApplicationCommandInteractionDataOptionSubCommand {
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
name: string;
type: ApplicationCommandOptionType.SUB_COMMAND;
type: ApplicationCommandOptionType.SUB_COMMAND_GROUP;
options: ApplicationCommandInteractionDataOptionSubCommand[];
}
@@ -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
*/

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "discord-api-types",
"version": "0.13.0",
"version": "0.13.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.13.0",
"version": "0.13.2",
"license": "MIT",
"devDependencies": {
"@commitlint/cli": "^12.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.13.0",
"version": "0.13.2",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"main": "./default/index.js",
"types": "./default/index.d.ts",

View File

@@ -188,7 +188,7 @@ export interface ApplicationCommandInteractionDataOptionSubCommand {
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
name: string;
type: ApplicationCommandOptionType.SUB_COMMAND;
type: ApplicationCommandOptionType.SUB_COMMAND_GROUP;
options: ApplicationCommandInteractionDataOptionSubCommand[];
}
@@ -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
*/