Commit bd52aebd authored by nanahira's avatar nanahira

use context plugin

parent a6e293ea
Pipeline #4468 passed with stages
in 1 minute and 4 seconds
import { Context } from "koishi-core"; import 'source-map-support/register';
import _ from "lodash"; import { PluginContext, Plugin, Apply } from 'koishi-dev-utils';
import _ from 'lodash';
import "source-map-support/register";
interface Config { interface Config {
prefix: string; prefix: string;
} }
export const name = "plugin_name"; @Plugin('my-plugin')
export function apply(ctx: Context, config: Config = { prefix: "message" }) { class MyPlugin extends PluginContext<Config> {
ctx.command("echo <message:text>").action((argv, message) => { @Apply
return _.join([config.prefix, message], ":"); init() {
this.command('echo <message:text>').action((argv, message) => {
return _.join([this.config.prefix, message], ':');
}); });
}
} }
export = new MyPlugin();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment