class Command
implements CommandOptions
Re-export
import { Command } from "https://deno.land/x/harmony@v2.9.1/src/commands/mod.ts";
Properties
Methods
afterExecute<T>(ctx: CommandContext, executeResult: T): unknown | Promise<unknown>
Method executed after executing command, passes on CommandContext and the value returned by execute too. (optional)
beforeExecute(ctx: CommandContext):
| boolean
| Promise<boolean>
| unknown
| Promise<unknown>
Method executed before executing actual command. Returns bool value - whether to continue or not (optional)
execute(ctx: CommandContext): unknown | Promise<unknown>
Actual command code, which is executed when all checks have passed.
getSubCommands(): Command[]
Get an Array of Sub Commands, including decorated ones
onError(ctx: CommandContext, error: Error): unknown | Promise<unknown>
Method called when the command errors
onMissingArgs(ctx: CommandContext): unknown | Promise<unknown>
Method called when there are missing arguments
toString(): string
Static Properties
optional
meta: CommandOptions