Commit 32c4ce82 authored by nanahira's avatar nanahira

struct

parent bd52aebd
Pipeline #4469 passed with stages
in 41 seconds
import 'source-map-support/register';
import { PluginContext, Plugin, Apply } from 'koishi-dev-utils';
import _ from 'lodash';
import { Context } from 'koishi-core';
import { Config, MyPlugin } from './plguin';
interface Config {
prefix: string;
export const name = 'my-plugin-index';
export function apply(ctx: Context, config: Config) {
ctx.plugin(new MyPlugin(), config);
}
@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