F

register

Adds commands to the shared Unbound section of the / picker. Registering a root name again replaces that whole command; a root name another owner has throws CommandDefinitionError.

function register<T>(commands: CommandTree<T>): () => void

Parameters

NameTypeDescription
commandsCommandTree<T>

The commands, keyed by root name.

Returns

() => void

A function that removes this call's commands; it is safe to call twice.