diff --git a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt index 0fcf9915b..d1f4800d2 100644 --- a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt +++ b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt @@ -104,6 +104,7 @@ object MiraiConsole { */ fun stop() { PluginManager.disableAllPlugins() + CommandManager.cancel() try { bots.forEach { it.get()?.close() diff --git a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandManager.kt b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandManager.kt index b0b7dd9bc..bb2510c8b 100644 --- a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandManager.kt +++ b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandManager.kt @@ -154,7 +154,9 @@ object CommandManager : Job by { } catch (e: Throwable) {//should never happen e.printStackTrace() } - processCommandQueue() + if(isActive) { + processCommandQueue() + } } }