SerenityJS
    Preparing search index...

    Class CommandRegistry

    Index

    Constructors

    Properties

    debug: boolean = false

    The will make the command appear with a debug flag in the available commands list.

    overloads: Map<CommandOverload, CommandCallback> = ...

    The overloads of the command.

    permissions: string[] = []

    The permissions of the command.

    subcommands: Map<string, SubCommand<unknown>> = ...

    The subcommands of the command.

    Methods

    • Registers a subcommand with the given name, description, and callback.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • name: string

        The name of the subcommand.

      • description: string

        The description of the subcommand.

      • callback: CommandCallback<T>

        The callback of the subcommand.

      • Optionalaliases: string[]

        The aliases of the subcommand.

      Returns SubCommand<T>

      The subcommand that was registered.

    • Registers a subcommand with the given name, description, registry callback, and execution callback.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • name: string

        The name of the subcommand.

      • description: string

        The description of the subcommand.

      • registry: CommandRegistryCallback

        The registry callback of the subcommand.

      • callback: CommandCallback<T>

        The execution callback of the subcommand.

      • Optionalaliases: string[]

        The aliases of the subcommand.

      Returns SubCommand<T>

      The subcommand that was registered.