mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 17:00:14 +08:00
Add MiraiConsoleImplementation.isInitialized
This commit is contained in:
parent
ac36a560fb
commit
8f61943c70
@ -18,8 +18,8 @@ import net.mamoe.mirai.console.MiraiConsoleImplementation.Companion.start
|
|||||||
import net.mamoe.mirai.console.command.ConsoleCommandSender
|
import net.mamoe.mirai.console.command.ConsoleCommandSender
|
||||||
import net.mamoe.mirai.console.data.PluginDataStorage
|
import net.mamoe.mirai.console.data.PluginDataStorage
|
||||||
import net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge
|
import net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge
|
||||||
import net.mamoe.mirai.console.logging.LoggerController
|
|
||||||
import net.mamoe.mirai.console.internal.logging.LoggerControllerImpl
|
import net.mamoe.mirai.console.internal.logging.LoggerControllerImpl
|
||||||
|
import net.mamoe.mirai.console.logging.LoggerController
|
||||||
import net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader
|
import net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader
|
||||||
import net.mamoe.mirai.console.plugin.loader.PluginLoader
|
import net.mamoe.mirai.console.plugin.loader.PluginLoader
|
||||||
import net.mamoe.mirai.console.util.ConsoleInput
|
import net.mamoe.mirai.console.util.ConsoleInput
|
||||||
@ -185,12 +185,27 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
|||||||
* 可由前端调用, 获取当前的 [MiraiConsoleImplementation] 实例
|
* 可由前端调用, 获取当前的 [MiraiConsoleImplementation] 实例
|
||||||
*
|
*
|
||||||
* 必须在 [start] 之后才能使用, 否则抛出 [UninitializedPropertyAccessException]
|
* 必须在 [start] 之后才能使用, 否则抛出 [UninitializedPropertyAccessException]
|
||||||
|
*
|
||||||
|
* @see isInitialized
|
||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@ConsoleFrontEndImplementation
|
@ConsoleFrontEndImplementation
|
||||||
public fun getInstance(): MiraiConsoleImplementation = instance
|
public fun getInstance(): MiraiConsoleImplementation = instance
|
||||||
|
|
||||||
/** 由前端调用, 初始化 [MiraiConsole] 实例并启动 */
|
/**
|
||||||
|
* 当 [MiraiConsoleImplementation] 已经初始化后返回 `true`
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
@ConsoleFrontEndImplementation
|
||||||
|
public val isInitialized: Boolean
|
||||||
|
get() = ::instance.isInitialized
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 由前端调用, 初始化 [MiraiConsole] 实例并启动
|
||||||
|
*
|
||||||
|
* @see getInstance
|
||||||
|
* @see isInitialized
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@ConsoleFrontEndImplementation
|
@ConsoleFrontEndImplementation
|
||||||
@Throws(MalformedMiraiConsoleImplementationError::class)
|
@Throws(MalformedMiraiConsoleImplementationError::class)
|
||||||
|
Loading…
Reference in New Issue
Block a user