Connect with us

Kotori - Plugins

);

// weather-plugin.ts import definePlugin from 'kotori'; export default definePlugin( name: 'weather', version: '1.0.0', mount(api) api.on('message', async (ctx) => if (ctx.content.startsWith('!weather')) const city = ctx.content.split(' ')[1]; const weather = await fetchWeather(city); await ctx.reply( Weather in $city: $weather ); kotori plugins

If you value clean architecture, cross-platform reach, and TypeScript bliss, Kotori’s plugin system isn’t just solid — it’s a foundation you can trust. ); // weather-plugin

); , unmount() console.log('Weather plugin unloaded'); // weather-plugin.ts import definePlugin from 'kotori'

api.use(async (ctx, next) => ctx.content = ctx.content.trim().toLowerCase(); await next(); ); Kotori automatically merges plugin-specific config from the main config file and passes it to the plugin:

import definePlugin from 'kotori'; export default definePlugin( name: 'echo', mount(api) api.on('message', async (ctx) => if (ctx.content.startsWith('!echo ')) const text = ctx.content.slice(6); await ctx.reply(text);