RuntimePlugin extends PluginCommon<T, CommandKitPluginRuntime>
new RuntimePlugin(options)
Parameter | Type | Optional |
---|
options | T | ❌ |
Properties
public name: any
public options: any
Methods
Called when this plugin is activated
public deactivate(ctx): Promise<void>
Called when this plugin is deactivated
public executeCommand(ctx, env, source, command, execute): Promise<boolean>
Called before command is executed. This method can execute the command itself.
public onAfterClientLogin(ctx): Promise<void>
Called after the client logs in
public onAfterCommand(ctx, env): Promise<void>
Called after command and all of its deferred functions are executed.
public onAfterCommandsLoad(ctx): Promise<void>
Called after commands are loaded
public onAfterEventsLoad(ctx): Promise<void>
Called after events are loaded
public onBeforeClientLogin(ctx): Promise<void>
Called before the client logs in
public onBeforeCommandsLoad(ctx): Promise<void>
Called before commands are loaded
public onBeforeEventsLoad(ctx): Promise<void>
Called before events are loaded
public onBeforeInteraction(ctx, interaction): Promise<void>
Called before interaction is handled
public onBeforeMessageCommand(ctx, message): Promise<void>
Called before message command is processed
public onBeforePrepareGuildCommandsRegistration(ctx, event): Promise<void>
Called before guild commands registration. This method can cancel the registration of the command and handle it manually.
This method is called before guilds of the command are resolved. It is called after onBeforeRegisterCommands
if that stage was not handled.
Parameter | Type | Optional | Description |
---|
ctx | CommandKitPluginRuntime | ❌ | The context |
event | PreRegisterCommandsEvent | ❌ | The command registration data |
public onBeforeRegisterCommands(ctx, event): Promise<void>
Called before command is registered to discord. This method can cancel the registration of the command and handle it manually.
public onBeforeRegisterGlobalCommands(ctx, event): Promise<void>
Called before global commands registration. This method can cancel the registration of the command and handle it manually.
This method is called after onBeforeRegisterCommands
if that stage was not handled.
Parameter | Type | Optional | Description |
---|
ctx | CommandKitPluginRuntime | ❌ | The context |
event | PreRegisterCommandsEvent | ❌ | The command registration data |
public onBeforeRegisterGuildCommands(ctx, event): Promise<void>
Called before guild commands registration. This method can cancel the registration of the command and handle it manually.
This method is called after guilds of the command are resolved. It is called after onBeforePrepareGuildCommandsRegistration
if that stage was not handled.
Parameter | Type | Optional | Description |
---|
ctx | CommandKitPluginRuntime | ❌ | The context |
event | PreRegisterCommandsEvent | ❌ | The command registration data |
public onCommandsRouterInit(ctx): Promise<void>
Called after commands router is initialized
public onEventsRouterInit(ctx): Promise<void>
Called after events router is initialized
Called when HMR event is received
public prepareCommand(ctx, commands): Promise<null | CommandBuilderLike>
Called before command is loaded for registration. This method can be used to modify the command data before it is loaded.
Parameter | Type | Optional | Description |
---|
ctx | CommandKitPluginRuntime | ❌ | The context |
commands | CommandBuilderLike | ❌ | The command that is being loaded. This is a CommandBuilderLike object which represents Discord's command |