Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CommandManager

The Command manager. You should never have to create an instance of this class.

Hierarchy

Index

Constructors

Properties

application: null | ClientApplication | Guild = null

The application this manager will use to set interaction commands.

cache: Collection<string, Command> = ...

The cache of items for this manager.

directories: Set<string> = ...

The directories this manager will load commands from.

Accessors

Methods

  • filterByKind(commands: any[], kinds: Kind[]): Command[]
  • loadFileAsCommand(filePath: string, categoryName?: string): Promise<void>
  • Load the command(s) from a file.

    Parameters

    • filePath: string

      The path to the file to load.

    • categoryName: string = ''

      Set the category of the command to this.

    Returns Promise<void>

  • loadFolderAsCategory(folderPath: string, categoryName?: string): Promise<void>
  • Loads a folder as a category.

    Parameters

    • folderPath: string

      The path to the folder to load commands from.

    • categoryName: string = ''

      Set each command to this category.

    Returns Promise<void>

  • loadFolderAsCommandGroup(itemName: string, folderPath: string, categoryName?: string, cache?: boolean): Promise<Command>
  • Load a folder as a subcommand group, and its contents as subcommands.

    Parameters

    • itemName: string

      The name of the subcommand group.

    • folderPath: string

      The path to the folder to load commands from.

    • categoryName: string = ''

      Set the category of the command to this.

    • cache: boolean = false

      Whether to set the command to the cache.

    Returns Promise<Command>

  • loadFolderAsCommandOptions(folderPath: string, categoryName?: string): Promise<Command[]>
  • Load a folder as an array of commands.

    Parameters

    • folderPath: string

      The path to the folder to load commands from.

    • categoryName: string = ''

      Set the category of the command(s) to this.

    Returns Promise<Command[]>