Init all command properties on register

This commit is contained in:
Him188 2020-09-13 00:29:23 +08:00
parent aa3c8baccb
commit d59d67ad9e

View File

@ -99,7 +99,11 @@ internal object CommandManagerImpl : CommandManager, CoroutineScope by Coroutine
}
override fun Command.register(override: Boolean): Boolean {
if (this is CompositeCommand) this.subCommands // init
if (this is CompositeCommand) this.subCommands // init lazy
this.permission // init lazy
this.names // init lazy
this.description // init lazy
this.usage // init lazy
modifyLock.withLock {
if (!override) {