mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Add getInstance for front-end implementers
This commit is contained in:
parent
9e6b76b6cb
commit
cd6e78d36c
@ -175,6 +175,15 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
||||
internal lateinit var instance: MiraiConsoleImplementation
|
||||
private val initLock = ReentrantLock()
|
||||
|
||||
/**
|
||||
* 可由前端调用, 获取当前的 [MiraiConsoleImplementation] 实例
|
||||
*
|
||||
* 必须在 [start] 之后才能使用.
|
||||
*/
|
||||
@JvmStatic
|
||||
@ConsoleFrontEndImplementation
|
||||
public fun getInstance(): MiraiConsoleImplementation = instance
|
||||
|
||||
/** 由前端调用, 初始化 [MiraiConsole] 实例并启动 */
|
||||
@JvmStatic
|
||||
@ConsoleFrontEndImplementation
|
||||
|
Loading…
Reference in New Issue
Block a user