Commit f16aab9e authored by nanahira's avatar nanahira

add constructor in config schema

parent eaa24757
......@@ -17,6 +17,7 @@ export interface ServerLike {
@RegisterSchema({ description: 'SRVPro 服务器' })
export class Server implements ServerLike {
constructor(config: Partial<Server>) {}
@DefineSchema({ description: '服务器名称', required: true })
name: string;
......@@ -71,13 +72,18 @@ export interface MyPluginConfigLike {
@RegisterSchema({ required: true })
export class MyPluginConfig implements MyPluginConfigLike {
constructor(config: Partial<MyPluginConfig>) {}
@DefineSchema({ description: '服务器列表命令名', default: 'serverlist' })
listCommandName: string;
@DefineSchema({ description: '房间列表命令名', default: 'roomlist' })
roomCommandName: string;
@DefineSchema({ type: Server, required: true, description: 'SRVPro 服务器列表' })
@DefineSchema({
type: Server,
required: true,
description: 'SRVPro 服务器列表',
})
servers: Server[];
getServer(value: string) {
......
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