Skip to content

@pumpkin-plugins/docs API / commands / defineCommands

Function: defineCommands() ​

defineCommands<Name, T>(_pluginName, tree): T

Defined in: tools/docs/src/commands.ts:172

Declares a plugin's commands. The same object registers them with Pumpkin and documents them in the README, so the two can't drift apart.

Type Parameters ​

Name ​

Name extends string

T ​

T extends CommandTree<`${Name}:${string}`>

Parameters ​

_pluginName ​

Name

The plugin's name. It only constrains the permission nodes to start with it.

tree ​

T

The commands.

Returns ​

T

The tree, with its literal types kept.

Pumpkin Plugins documentation