spec unchanged). install() must be synchronous.
Type Parameters
Parameters
Returns
PluginSpec<TConfig>
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Function exported by @botmesh/core.
function definePlugin<TConfig>(spec): PluginSpec<TConfig>;
spec unchanged). install() must be synchronous.
| Parameter | Type |
|---|---|
spec | PluginSpec<TConfig> |
PluginSpec<TConfig>
const greeter = definePlugin<{ text?: string }>({
name: 'greeter',
version: '1.0.0',
install({ bot }, config) {
bot.when('hello', (ctx) => ctx.reply(config?.text ?? 'Hi!'))
},
})
bot.plug(greeter, { text: 'Welcome!' })