Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CommandSet

Hierarchy

  • CommandSet

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

helpHandler

helpHandler: HelpHandler | undefined = undefined

If defined, called when Command.help is called and if the command didn't define its own help handler.

Accessors

commands

Methods

buildin

  • buildin(buildinCommandNames: "all"): void
  • buildin(...buildinCommandNames: BuildInCommand[]): void

loadCommands

  • loadCommands(commandDirPath: string, includeTS?: boolean): void
  • Loads commands from the given folder path. Command files must have the extension .cmd.js.

    Parameters

    • commandDirPath: string

      The path to the folder where the commands are (relative to node entry point).

    • Default value includeTS: boolean = false

      If set to true, files with .cmd.ts extension are also loaded. Usefull if you use ts-node (default is false)

    Returns void

parse

  • Parses the message's content and executes the command.

    Parameters

    • message: Message

      The message to parse.

    • Optional options: DeepPartial<CommandSetOptions>

      Options to define the parsing behaviour.

    Returns Promise<CommandResult>

    The result of the parsing.

reload

Generated using TypeDoc