mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-09 06:34:44 +08:00
mirai console shutdown logic
This commit is contained in:
parent
2a82fe6b80
commit
e284267d47
@ -49,6 +49,8 @@ object MiraiConsole {
|
||||
var coreVersion = "v0.15.1"
|
||||
val build = "Beta"
|
||||
|
||||
var allDown = false
|
||||
|
||||
lateinit var frontEnd: MiraiConsoleUI
|
||||
fun start(
|
||||
frontEnd: MiraiConsoleUI
|
||||
@ -80,6 +82,7 @@ object MiraiConsole {
|
||||
|
||||
fun stop() {
|
||||
PluginManager.disableAllPlugins()
|
||||
allDown = true
|
||||
bots.forEach {
|
||||
it.get()?.close()
|
||||
}
|
||||
@ -290,6 +293,9 @@ object MiraiConsole {
|
||||
}
|
||||
|
||||
tailrec fun processNextCommandLine() {
|
||||
if (allDown) {
|
||||
return
|
||||
}
|
||||
var fullCommand = commandChannel.poll()
|
||||
if (fullCommand != null) {
|
||||
if (!fullCommand.startsWith("/")) {
|
||||
|
Loading…
Reference in New Issue
Block a user