From 7a39a3b96e29394efe225e12c147a101db23fa34 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 17 Aug 2023 14:42:50 +0300 Subject: [PATCH] fix typings --- src/classes/Command.ts | 5 ++--- src/interfaces/Command.ts | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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 }