Skip to content

CommandRegistry

Defined in: packages/core/src/commands.ts:563

Adds slash and prefix commands and runs them. Reached as bot.commands.

new CommandRegistry(bot): CommandRegistry

Defined in: packages/core/src/commands.ts:569

Client

CommandRegistry

add(…commands): this

Defined in: packages/core/src/commands.ts:577

Adds commands, replacing one with the same name.

…Command<OptionMap>[]

this

If a prefix name or alias is already taken by another command.


deploy(options?): Promise<number>

Defined in: packages/core/src/commands.ts:621

Registers the slash commands with Discord, replacing the ones already registered. Call it once the client is ready.

guildId registers them in one guild (instant) instead of globally.

string

Promise<number>

How many were registered.

If the client is not ready.


get(name): Command<OptionMap> | undefined

Defined in: packages/core/src/commands.ts:605

The command named name (or one of its prefix aliases).

string

Command<OptionMap> | undefined


list(): Command<OptionMap>[]

Defined in: packages/core/src/commands.ts:610

Every command, in the order they were added.

Command<OptionMap>[]


listen(options?): this

Defined in: packages/core/src/commands.ts:646

Starts answering: slash commands from interactions and, when prefix is given, prefix commands from messages.

string | readonly string[]

The text a message starts with, or several.

this

If called twice.