From 4f418e7a0b07b2a29642c569ca1008326595ca6a Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 22 Jun 2020 12:14:03 +0800 Subject: [PATCH] Initialize MiraiConsole when MiraiConsoleInitializer.init called --- .../src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt index f63f56688..7cf716a36 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt @@ -32,6 +32,7 @@ internal object MiraiConsoleInitializer { /** 由前端调用 */ internal fun init(instance: IMiraiConsole) { this.instance = instance + MiraiConsole.initialize() } } @@ -95,6 +96,10 @@ object MiraiConsole : CoroutineScope, IMiraiConsole { @MiraiExperimentalAPI fun newLogger(identity: String?): MiraiLogger = frontEnd.loggerFor(identity) + + internal fun initialize() { + // Only for initialize + } }