CommandRegistry
Defined in: packages/core/src/commands.ts:563
Adds slash and prefix commands and runs them. Reached as bot.commands.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CommandRegistry(
bot):CommandRegistry
Defined in: packages/core/src/commands.ts:569
Parameters
Section titled “Parameters”Returns
Section titled “Returns”CommandRegistry
Methods
Section titled “Methods”add(…
commands):this
Defined in: packages/core/src/commands.ts:577
Adds commands, replacing one with the same name.
Parameters
Section titled “Parameters”commands
Section titled “commands”Returns
Section titled “Returns”this
Throws
Section titled “Throws”If a prefix name or alias is already taken by another command.
deploy()
Section titled “deploy()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”guildId registers them in one guild (instant) instead of globally.
guildId?
Section titled “guildId?”string
Returns
Section titled “Returns”Promise<number>
How many were registered.
Throws
Section titled “Throws”If the client is not ready.
Defined in: packages/core/src/commands.ts:605
The command named name (or one of its prefix aliases).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Command<OptionMap> | undefined
list()
Section titled “list()”Defined in: packages/core/src/commands.ts:610
Every command, in the order they were added.
Returns
Section titled “Returns”listen()
Section titled “listen()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”prefix?
Section titled “prefix?”string | readonly string[]
The text a message starts with, or several.
Returns
Section titled “Returns”this
Throws
Section titled “Throws”If called twice.