浏览代码

Fix unhandled `BotOfflineEvent.Force`

Him188 5 年之前
父节点
当前提交
1f97454b37
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotImpl.kt

+ 1 - 1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotImpl.kt

@@ -93,7 +93,7 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
     @Suppress("unused")
     private val offlineListener: Listener<BotOfflineEvent> =
         [email protected](concurrency = Listener.ConcurrencyKind.LOCKED) { event ->
-            if (network.areYouOk()) {
+            if (network.areYouOk() && event !is BotOfflineEvent.Force) {
                 // avoid concurrent re-login tasks
                 return@subscribeAlways
             }