Snek Lifecycle¶
You can override several methods to hook into command handler's lifecycle.
These methods start with Exec*
ExecOnMessageAsyncruns first right after any message was receivedExecInputTransformAsyncruns after ExecOnMessageAsync and allows you to transform the message content before the bot looks for the matching commandExecPreCommandAsyncruns after a command was found but not executed, allowing you to potentially prevent command executionExecPostCommandAsyncruns if the command was successfully executedExecOnNoCommandAsyncruns instead of ExecPostCommandAsync if no command was found for a message
Besides that, sneks have 2 methods with which you can initialize and cleanup your snek
InitializeAsyncRuns when the medusa which contains this snek is being loadedDisposeAsyncRuns when the medusa which contains this snek is being unloaded