CommandGroup
Central class that manages all registered commands. This is the starting point for the plugin, and this is what you should pass to bot
so your commands get properly registered.
Type Parameters
C
C extends Context
Constructors
CommandGroup(options: Partial<CommandOptions>);
Methods
command
// Overload 1
command(
name: string | RegExp,
description: string,
handler: MaybeArray<Middleware<CommandContext<C>>>,
options?: Partial<CommandOptions>,
): Command<C>;
// Overload 2
command(
name: string | RegExp,
description: string,
options?: Partial<CommandOptions>,
): Command<C>;
Registers a new command with a default handler.
add
Registers a Command that was created by it’s own.
toArgs
toArgs();
Serializes the commands into multiple objects that can each be passed to a set
call.
toSingleScopeArgs
toSingleScopeArgs(scope: BotCommandScope);
Serializes the commands of a single scope into objects that can each be passed to a set
call.
setCommands
Registers all commands to be displayed by clients according to their scopes and languages Calls set
for each language of each scope of each command.
[!IMPORTANT] Calling this method with upperCased command names registered, will throw
toElementals
toElementals(filterLanguage?: LanguageCode | "default"): CommandElementals[];
Serialize all register commands into it’s name, prefix and language
toString
toString();
middleware
middleware();
commands (getter)
prefixes (getter)
get prefixes(): string[];
[Symbol.for("Deno.customInspect")]
[Symbol.for("Deno.customInspect")]();
Replaces the to
method on Deno
[Symbol.for("nodejs.util.inspect.custom")]
[Symbol.for("nodejs.util.inspect.custom")]();
Replaces the to
method on Node.js