Commit 0e4b57b1 authored by nanahira's avatar nanahira

fixes

parent bcfba94a
Pipeline #6064 passed with stages
in 1 minute and 16 seconds
...@@ -4,6 +4,8 @@ import { Config, MyPlugin } from './plugin'; ...@@ -4,6 +4,8 @@ import { Config, MyPlugin } from './plugin';
export { Config } from './plugin'; export { Config } from './plugin';
export const name = 'my-plugin'; export const name = 'my-plugin';
const plugin = new MyPlugin();
export const schema = plugin.schema;
export function apply(ctx: Context, config: Config) { export function apply(ctx: Context, config: Config) {
ctx.plugin(new MyPlugin(), config); ctx.plugin(plugin, config);
} }
import 'source-map-support/register'; import 'source-map-support/register';
import { Context } from 'koishi-core'; import { Context, Schema } from 'koishi-core';
import _ from 'lodash'; import _ from 'lodash';
export interface Config { export interface Config {
...@@ -11,6 +11,9 @@ export class MyPlugin { ...@@ -11,6 +11,9 @@ export class MyPlugin {
config: Config config: Config
ctx: Context; ctx: Context;
name = 'my-plugin-main'; name = 'my-plugin-main';
schema: Schema<Config> = Schema.object({
prefix: Schema.string('desc')
});
apply(ctx: Context, config: Config) { apply(ctx: Context, config: Config) {
this.ctx = ctx; this.ctx = ctx;
this.config = config; this.config = config;
......
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