Skip to main content
Version: 1.x

CommandRegistrar

CommandRegistrar

Handles registration of Discord application commands (slash commands, context menus).

Signature
class CommandRegistrar {
constructor(commandkit: CommandKit)
getCommandsData() => (CommandData & {
__metadata?: CommandMetadata;
__applyId(id: string): void;
})[];
register() => ;
updateGlobalCommands(commands: (CommandData & {
__metadata?: CommandMetadata;
__applyId(id: string): void;
})[]) => ;
updateGuildCommands(commands: (CommandData & {
__metadata?: CommandMetadata;
__applyId(id: string): void;
})[]) => ;
}

constructor

method
(commandkit: CommandKit) => CommandRegistrar

Creates an instance of CommandRegistrar.

getCommandsData

method
() => (CommandData & { __metadata?: CommandMetadata; __applyId(id: string): void; })[]

Gets the commands data.

register

method
() =>

Registers loaded commands.

updateGlobalCommands

method
(commands: (CommandData & { __metadata?: CommandMetadata; __applyId(id: string): void; })[]) =>

Updates the global commands.

updateGuildCommands

method
(commands: (CommandData & { __metadata?: CommandMetadata; __applyId(id: string): void; })[]) =>

Updates the guild commands.