definePlugin
-
definePlugin<S>(setup: (plugin:
PluginContext<S>) => void) Declares a plugin.
setupruns once when the deployment loads and must be synchronous, because commands and handlers are collected at publish.weeble.definePlugin<{ channel: string }>((plugin) => { plugin.on('MESSAGE_REACTION_ADD', async (reaction) => { await plugin.kv().increment(reaction.messageId); }); });
Outside an installed plugin, for example while testing in the editor,
slugisdevandsettingsis empty.- Type parameters:
S – (extends PluginSettings)