Commit 1376e58f authored by nanahira's avatar nanahira

Migrate schema to Config

parent aac621d4
import 'source-map-support/register';
import type { Context } from 'koishi';
import { Config, MyPlugin } from './plugin';
export { Config } from './plugin';
import { PluginConfig, MyPlugin } from './plugin';
export * from './plugin';
export const name = 'limit-help';
const plugin = new MyPlugin();
export const schema = plugin.schema;
export function apply(ctx: Context, config: Config) {
export const Config = plugin.schema;
export function apply(ctx: Context, config: PluginConfig) {
ctx.plugin(plugin, config);
}
......@@ -20,16 +20,16 @@ export interface Selection extends BaseSelection {
$not?: Selection;
}
export type Config = Selection;
export type PluginConfig = Selection;
export class MyPlugin {
config: Config;
config: PluginConfig;
ctx: Context;
name = 'limit-help-main';
schema: Schema<Selection> = Schema.any().description('帮助作用域').default({
$user: '10000',
});
apply(ctx: Context, config: Config) {
apply(ctx: Context, config: PluginConfig) {
this.ctx = ctx;
this.config = config;
this.disableHelp();
......
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