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 _ from "lodash";
import "source-map-support/register";
import 'source-map-support/register';
import { PluginContext, Plugin, Apply } from 'koishi-dev-utils';
import _ from 'lodash';
interface Config {
prefix: string;
}
export const name = "plugin_name";
export function apply(ctx: Context, config: Config = { prefix: "message" }) {
ctx.command("echo <message:text>").action((argv, message) => {
return _.join([config.prefix, message], ":");
});
@Plugin('my-plugin')
class MyPlugin extends PluginContext<Config> {
@Apply
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