refactor: chat & command tabComplete

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-09-22 15:29:12 +08:00
parent 68a996f830
commit af85703bd9
10 changed files with 85 additions and 75 deletions

View File

@ -13,6 +13,9 @@ export class SpringCommand extends command.Command {
protected create(plugin: any, command: string) {
return this.commandMap.register(plugin, command)
}
public tabComplete(sender: any, input: string, index?: number): string[] {
return this.commandMap.tabComplate(sender, input, index)
}
protected remove(plugin: any, command: string) {
this.commandMap.unregister(plugin, command)
}

View File

@ -1,6 +1,6 @@
import { server } from '@ccms/api'
import { provideSingleton, inject } from '@ccms/container'
import { NativePluginManager } from '@ccms/api/dist/interfaces/server/native_plugin'
import { NativePluginManager } from '@ccms/api'
import { CommandMap } from './internal/command'
@provideSingleton(server.Server)
@ -8,8 +8,6 @@ export class SpringServer implements server.Server {
@inject(CommandMap)
private commandMap: CommandMap
constructor() {
}
getVersion(): string {
return "SpringFramework"
}
@ -47,10 +45,4 @@ export class SpringServer implements server.Server {
getRootLogger() {
return Packages.org.slf4j.LoggerFactory.getLogger("root") || global.logger
}
sendJson(sender: any, json: string | object): void {
throw new Error("Method not implemented.")
}
tabComplete(sender: any, input: string, index?: number) {
return this.commandMap.tabComplate(sender, input, index)
}
}