mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 00:30:17 +08:00
Fix wrong initialization order
This commit is contained in:
parent
a21740ed3c
commit
4d69ae617f
@ -15,7 +15,6 @@ import kotlinx.io.charsets.Charset
|
|||||||
import net.mamoe.mirai.Bot
|
import net.mamoe.mirai.Bot
|
||||||
import net.mamoe.mirai.console.plugin.PluginLoader
|
import net.mamoe.mirai.console.plugin.PluginLoader
|
||||||
import net.mamoe.mirai.console.plugin.jvm.JarPluginLoader
|
import net.mamoe.mirai.console.plugin.jvm.JarPluginLoader
|
||||||
import net.mamoe.mirai.console.plugin.jvm.JvmPlugin
|
|
||||||
import net.mamoe.mirai.utils.DefaultLogger
|
import net.mamoe.mirai.utils.DefaultLogger
|
||||||
import net.mamoe.mirai.utils.MiraiExperimentalAPI
|
import net.mamoe.mirai.utils.MiraiExperimentalAPI
|
||||||
import net.mamoe.mirai.utils.MiraiLogger
|
import net.mamoe.mirai.utils.MiraiLogger
|
||||||
@ -24,17 +23,23 @@ import java.io.File
|
|||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
|
|
||||||
/**
|
internal object MiraiConsoleInitializer {
|
||||||
* mirai 控制台实例.
|
internal lateinit var instance: IMiraiConsole
|
||||||
*/
|
|
||||||
object MiraiConsole : CoroutineScope, IMiraiConsole {
|
|
||||||
private lateinit var instance: IMiraiConsole
|
|
||||||
|
|
||||||
/** 由前端调用 */
|
/** 由前端调用 */
|
||||||
internal fun init(instance: IMiraiConsole) {
|
internal fun init(instance: IMiraiConsole) {
|
||||||
this.instance = instance
|
this.instance = instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mirai 控制台实例.
|
||||||
|
*/
|
||||||
|
object MiraiConsole : CoroutineScope, IMiraiConsole {
|
||||||
|
private val instance: IMiraiConsole
|
||||||
|
get() = MiraiConsoleInitializer.instance
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `mirai-console` build 号
|
* `mirai-console` build 号
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user