fix: event execute class type error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-02-25 23:15:39 +08:00
parent eba21c08dc
commit e323467ed8
4 changed files with 36 additions and 8 deletions

View File

@ -20,7 +20,13 @@ export namespace interfaces {
public disable() { }
}
interface BaseMetadata {
/**
* 名称 为空则为对象名称
*/
name?: string;
/**
* 支持的服务器列表 为空则代表所有
*/
servers?: string[];
}
export interface PluginMetadata extends BaseMetadata {
@ -50,19 +56,37 @@ export namespace interfaces {
target?: any;
}
interface ExecMetadata extends BaseMetadata {
/**
* 执行器
*/
executor?: string;
}
export interface CommandMetadata extends ExecMetadata {
/**
* 参数列表
*/
paramtypes?: string[];
}
export interface TabCompleterMetadata extends ExecMetadata {
/**
* 参数列表
*/
paramtypes?: string[];
}
export interface ListenerMetadata extends ExecMetadata {
}
export interface ConfigMetadata extends BaseMetadata {
/**
* 配置文件版本号
*/
version?: number;
/**
* 实体变量名称
*/
variable?: string;
/**
* 配置文件格式 默认 yml
*/
format?: string;
}
export type PluginLike = Plugin | string;

View File

@ -98,7 +98,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
try {
if (pl[func]) pl[func].call(pl)
} catch (ex) {
console.console(`§6插件 §b${pl.description.name} §6执行 §d${func} §6方法时发生错误 §4${ex}`)
console.console(`§6Plugin §b${pl.description.name} §6exec §d${func} §6function error §4${ex}`)
console.ex(ex)
}
}
@ -146,7 +146,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
this.updatePlugin(file)
this.createPlugin(file)
} catch (ex) {
console.console(`§6插件 §b${file.name} §6初始化时发生错误 §4${ex.message}`)
console.console(`§6Plugin §b${file.name} §6initialize error §4${ex.message}`)
console.ex(ex)
}
}