registerCommands
Function: registerCommands()
Section titled “Function: registerCommands()”registerCommands(
token,applicationId, …handlers):Promise<void>
Defined in: utils/registerCommands.ts:19
Registers application commands (Slash and Context Menus) with Discord’s API.
This function flattens the provided handlers, separates global from guild-specific commands, and performs a bulk overwrite for both.
Parameters
Section titled “Parameters”string | undefined
The Discord Bot token.
applicationId
Section titled “applicationId”string | undefined
The Discord Application ID.
handlers
Section titled “handlers”…FlatOrNestedArray<AnyHandler>
A rest parameter of handlers or arrays of handlers to register.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”If the API request to Discord fails.
