Removes all stored commands.
Returns an iterator of all [ID, TopLevelCommand] pairs.
Returns the command associated with the passed name.
Returns the currently stored top level commands, keyed by their ID.
Returns whether the passed ID belongs to a registered command.
Returns whether the passed command is registered.
Returns an iterator of all command IDs.
Locates a SubCommandGroup by its class tree, passing its parent and its class and returning the stored instance.
Locates a SubCommand by its declaration tree, passing its parent, group and its class and returning the stored instance.
// Suppose the structure:
// - SomeParentCommand
// -- SomeSubCommandGroup
// --- ChildSubCommand
const repo = this.bot.getCommandManager().getRepository();
repo.locateByClassTree(ChildSubCommand); // null
repo.locateByClassTree(SomeParentCommand, ChildSubCommand); // null
repo.locateByClassTree(SomeParentCommand, SomeSubCommandGroup, ChildSubCommand); // Stored instance of ChildSubCommand
Locates a SubCommand by its declaration tree, passing its parent class and its class and returning the stored instance.
Locates a ParentCommand by its declaration tree, passing its class and returning the stored instance.
Locates a StandaloneCommand by its declaration tree, passing its class and returning the stored instance.
Locates a stored command by its declaration tree, passing its constructors and returning the stored instance.
OptionalFirstChildClass: ImplementsSubCommandGroup<Types> | ImplementsSubCommand<Types>OptionalSecondChildClass: ImplementsSubCommand<Types>// Suppose the structure:
// - SomeStandaloneCommand
// - SomeParentCommand
// -- SomeSubCommand
// -- SomeSubCommandGroup
// --- ChildSubCommand
const repo = this.bot.getCommandManager().getRepository();
repo.locateByClassTree(SomeStandaloneCommand); // Stored instance of SomeStandaloneCommand
repo.locateByClassTree(SomeParentCommand); // Stored instance of SomeParentCommand
repo.locateByClassTree(SomeParentCommand, SomeSubCommandGroup); // Stored instance of SomeSubCommandGroup
repo.locateByClassTree(SomeParentCommand, ChildSubCommand); // null
Locates a TopLevelCommand by its name tree. Equal to CommandRepository#getCommandByName.
Locates a SubCommand or SubCommandGroup by its name tree.
Locates a SubCommand by its name tree.
Locates a Command by its name tree.
OptionalfirstChild: stringOptionalsecondChild: stringOptionalreturnOptionalvalue: anyOptionalthrowOptionale: anyReturns an iterator of all TopLevelCommands.
An object responsible for storing commands.