diff --git a/packages/commandkit/src/types/index.ts b/packages/commandkit/src/types/index.ts index 6490a77..319b5f0 100644 --- a/packages/commandkit/src/types/index.ts +++ b/packages/commandkit/src/types/index.ts @@ -82,16 +82,26 @@ type LocaleString = | 'uk' | 'vi'; -export type CommandData = { +type BaseCommandData = { name: string; - description: string; type?: CommandType; name_localizations?: Partial>; - description_localizations?: Partial>; dm_permission?: boolean; default_member_permissions?: string; nsfw?: boolean; +}; + +type ChatInputCommandData = BaseCommandData & { + type?: CommandType.ChatInput; + description: string; + description_localizations?: Partial>; options?: Array; }; +type UserOrMessageCommandData = BaseCommandData & { + type: CommandType.User | CommandType.Message; +}; + +export type CommandData = ChatInputCommandData | UserOrMessageCommandData; + export type CommandObject = Omit; diff --git a/packages/commandkit/tests/commands/ping.ts b/packages/commandkit/tests/commands/ping.ts index 80a8e7f..49cfa0b 100644 --- a/packages/commandkit/tests/commands/ping.ts +++ b/packages/commandkit/tests/commands/ping.ts @@ -3,7 +3,6 @@ import { SlashCommandProps, CommandOptions, CommandData, CommandType } from '../ export const data: CommandData = { name: 'ping', description: 'Pong!', - type: CommandType.ChatInput, }; export function run({ interaction, handler }: SlashCommandProps) {