Skip to content

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.

string | undefined

The Discord Bot token.

string | undefined

The Discord Application ID.

…FlatOrNestedArray<AnyHandler>

A rest parameter of handlers or arrays of handlers to register.

Promise<void>

If the API request to Discord fails.