From 3183bc401898dd27c4dea3c25a8356acf32299f5 Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 8 Sep 2020 21:43:00 +0800 Subject: [PATCH] Init ConsoleInput and BotManager on start --- .../console/internal/MiraiConsoleImplementationBridge.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt index 39eda192f..59108b740 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt @@ -39,6 +39,7 @@ import net.mamoe.mirai.console.permission.PermissionService import net.mamoe.mirai.console.plugin.PluginLoader import net.mamoe.mirai.console.plugin.PluginManager import net.mamoe.mirai.console.plugin.center.PluginCenter +import net.mamoe.mirai.console.util.BotManager import net.mamoe.mirai.console.util.ConsoleExperimentalAPI import net.mamoe.mirai.console.util.ConsoleInput import net.mamoe.mirai.utils.* @@ -110,11 +111,15 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, MiraiConsoleI } } + ConsoleInput + // start phase `load configurations`@{ mainLogger.verbose { "Loading configurations..." } ConsoleDataScope.reloadAll() + + BotManager } val pluginLoadSession: PluginManagerImpl.PluginLoadSession @@ -135,7 +140,7 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, MiraiConsoleI mainLogger.verbose { "${PluginManager.plugins.size} such plugin(s) loaded." } } - SingletonExtensionSelector // init + SingletonExtensionSelector.instance // init phase `load PermissionService`@{ mainLogger.verbose { "Loading PermissionService..." }