mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
types(ApplicationCommandData): Stronger typings for ApplicationCommandData variants. (#6382)
This commit is contained in:
24
typings/index.d.ts
vendored
24
typings/index.d.ts
vendored
@@ -2881,14 +2881,30 @@ export interface ApplicationAsset {
|
|||||||
type: 'BIG' | 'SMALL';
|
type: 'BIG' | 'SMALL';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApplicationCommandData {
|
export interface BaseApplicationCommandData {
|
||||||
name: string;
|
name: string;
|
||||||
description?: string;
|
|
||||||
type?: ApplicationCommandType | ApplicationCommandTypes;
|
|
||||||
options?: ApplicationCommandOptionData[];
|
|
||||||
defaultPermission?: boolean;
|
defaultPermission?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UserApplicationCommandData extends BaseApplicationCommandData {
|
||||||
|
type: 'USER' | ApplicationCommandTypes.USER;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageApplicationCommandData extends BaseApplicationCommandData {
|
||||||
|
type: 'MESSAGE' | ApplicationCommandTypes.MESSAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChatInputApplicationCommandData extends BaseApplicationCommandData {
|
||||||
|
description: string;
|
||||||
|
type: 'CHAT_INPUT' | ApplicationCommandTypes.CHAT_INPUT;
|
||||||
|
options?: ApplicationCommandOptionData[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ApplicationCommandData =
|
||||||
|
| UserApplicationCommandData
|
||||||
|
| MessageApplicationCommandData
|
||||||
|
| ChatInputApplicationCommandData;
|
||||||
|
|
||||||
export interface ApplicationCommandOptionData {
|
export interface ApplicationCommandOptionData {
|
||||||
type: ApplicationCommandOptionType | ApplicationCommandOptionTypes;
|
type: ApplicationCommandOptionType | ApplicationCommandOptionTypes;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user