mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-02 12:50:16 +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) {
|
if (allowActiveMaintenance) {
|
||||||
val bot = context.bot
|
val bot = context.bot
|
||||||
scope.launch(scope.hierarchicalName("BotOnlineWatchdog ${bot.id}")) {
|
scope.launch(scope.hierarchicalName("BotOnlineWatchdog ${bot.id}")) {
|
||||||
while (isActive) {
|
while (isActive && bot.isActive) {
|
||||||
val instance = selector.getCurrentInstanceOrCreate()
|
val instance = selector.getCurrentInstanceOrCreate()
|
||||||
|
|
||||||
awaitState(State.CLOSED) // suspend until next CLOSED
|
awaitState(State.CLOSED) // suspend until next CLOSED
|
||||||
|
Loading…
Reference in New Issue
Block a user