CommandInitPlugin
CommandInitPlugin<
I
>(execute
):Plugin
Creates an initialization plugin for command preprocessing and modification
Type parameters
• I extends CommandType
Extends CommandType to enforce type safety for command modules
Parameters
• execute
Function to execute during command initialization
Returns
A plugin that runs during command initialization
Since
2.5.0
Example
Example
Remarks
- Init plugins can modify how commands are loaded and perform preprocessing
- The module.locals object can be used to store custom plugin-specific data
- Be careful when modifying module fields as multiple plugins may interact with them
- Use controller.next() to continue to the next plugin
- Use controller.stop(reason) to halt plugin execution