diff --git a/src/classes/Command.ts b/src/classes/Command.ts index cf2b21a..b4dd054 100644 --- a/src/classes/Command.ts +++ b/src/classes/Command.ts @@ -1,9 +1,8 @@ import { OptionType } from "../interfaces/CommandOption.js"; -import { ICommand, CommandDefinition } from "../interfaces/Command.js"; +import { ICommand, CommandDefinition, CommandOpts } from "../interfaces/Command.js"; import SubcommandOption from "./SubcommandOption.js"; import SubcommandGroupOption from "./SubcommandGroupOption.js"; import CommandOption from "./CommandOption.js"; -import { ArgsResult } from "../Parser.js"; abstract class Command implements ICommand { @@ -48,7 +47,7 @@ abstract class Command implements ICommand { } - abstract execute(message: unknown, args?: ArgsResult): Promise; + abstract execute(message: unknown, args: CommandOpts): Promise; get subcommands (): SubcommandOption[] { return this._subcommands(this.options); diff --git a/src/interfaces/Command.ts b/src/interfaces/Command.ts index 3d2431d..3e1212b 100644 --- a/src/interfaces/Command.ts +++ b/src/interfaces/Command.ts @@ -5,7 +5,7 @@ import { ArgsResult } from '../Parser.js'; import { CommandOptionDefinition } from './CommandOption.js'; export type CommandOpts = { - args?: ArgsResult, + args: ArgsResult, subcommand?: string | null, subcommandGroup?: string | null } @@ -24,7 +24,7 @@ interface ICommand { subcommandGroup(name: string): SubcommandGroupOption | null - execute(message: unknown, opts?: CommandOpts): Promise + execute(message: unknown, opts: CommandOpts): Promise }