Runs once at startup, before connecting to Discord. Register listeners and create DB tables here.
OptionalreadyRuns after the bot successfully connects to Discord. Safe to access guild and user caches.
OptionalreloadRuns after a hot-reload. Re-wrap commands with middleware or refresh state here.
OptionalcleanupRuns on graceful shutdown. Clear intervals and close external connections here.
OptionalonCalled before every command or snap executes. Useful for analytics and tracing.
OptionalonOptionalonOptionalrequiresPlugin names that must be loaded before this plugin. Popii throws at startup if any listed plugin is missing.
OptionalconflictsPlugin names this plugin cannot coexist with. Popii throws at startup if any listed plugin is also present.
OptionalpriorityExecution order during the setup lifecycle. Higher values run first.
OptionalsettingsDeclarative per-guild settings exposed in the web dashboard's server settings form. The category defaults to the plugin name if omitted.
The interface all Popii plugins must implement.
A plugin is a plain object returned from a factory function. It hooks into the client lifecycle via
setup,ready,reload, andcleanup, and can also intercept every command execution viaonCommandExecuteandonCommandError.Example: Minimal plugin