Close all bots in console stopping

This commit is contained in:
Karlatemp 2021-03-10 12:30:45 +08:00
parent fa7d688467
commit 34135b5a4d
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -131,6 +131,7 @@ public object BuiltInCommands {
if (!MiraiConsole.isActive) return@withLock
sendMessage("Stopping mirai-console")
kotlin.runCatching {
Bot.instances.forEach { it.closeAndJoin() }
MiraiConsole.job.cancelAndJoin()
}.fold(
onSuccess = {