install() that registers handlers
through ctx.bot. Build one with definePlugin and plug it with bot.plug(plugin, config).
Type Parameters
Properties
name
version
description?
requires?
bot.plug() throws a descriptive
error before install() runs otherwise). Checked at plug time only.
multiple?
false: plugging a name that is
already plugged throws, so a plugin registered twice by mistake never runs its handlers
twice. Every instance must set it.
Methods
install()
bot.plug() does not await it. An async install (or one that returns a
promise) does not compile (SyncInstallError names the reason); at runtime a
rejected promise is still reported on the bot’s 'error' event, but the plugin is
already considered installed and nothing is rolled back. Do async setup lazily on first
use (the LazyProvider pattern in @botmesh/ai).
Parameters
Returns
|void
| "Plugin.install() must be synchronous and return nothing: bot.plug() does not await it. Do async setup lazily on first use (LazyProvider in @botmesh/ai)."
uninstall()?
Parameters
Returns
void | Promise<void>