fix: command registry error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-09-24 10:33:16 +08:00
parent 9c137574f5
commit afd04ed972
8 changed files with 46 additions and 41 deletions

View File

@@ -18,7 +18,10 @@ export class PluginEventManager {
let events = getPluginListenerMetadata(pluginInstance)
for (const event of events) {
// ignore space listener
if (!this.ServerChecker.check(event.servers)) { continue }
if (!this.ServerChecker.check(event.servers)) {
console.debug(`[${pluginInstance.description.name}] ${event.target.constructor.name} incompatible event ${event.name} server(${event.servers}) ignore.`)
continue
}
// here must bind this to pluginInstance
let exec = event.target[event.executor]
let execBinded = exec.bind(pluginInstance)