mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
Stop BotOnlineWatchdog if bot is closed
This commit is contained in:
parent
54a78313c8
commit
ad3bd4cc0d
@ -61,7 +61,7 @@ internal class SelectorNetworkHandler(
|
||||
if (allowActiveMaintenance) {
|
||||
val bot = context.bot
|
||||
scope.launch(scope.hierarchicalName("BotOnlineWatchdog ${bot.id}")) {
|
||||
while (isActive) {
|
||||
while (isActive && bot.isActive) {
|
||||
val instance = selector.getCurrentInstanceOrCreate()
|
||||
|
||||
awaitState(State.CLOSED) // suspend until next CLOSED
|
||||
|
Loading…
Reference in New Issue
Block a user