Browse Source

#1509 try to fix bot is closed manually

RainChan 4 years ago
parent
commit
b822c045d5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      mirai-core/src/commonMain/kotlin/QQAndroidBot.kt

+ 2 - 1
mirai-core/src/commonMain/kotlin/QQAndroidBot.kt

@@ -132,7 +132,8 @@ internal open class QQAndroidBot constructor(
                     cause is NetworkException && cause.recoverable -> {
                         eventDispatcher.broadcastAsync(BotOfflineEvent.Dropped(bot, cause))
                     }
-                    cause is BotClosedByEvent -> {
+                    cause == null ->{
+                        eventDispatcher.broadcastAsync(BotOfflineEvent.Dropped(bot, null))
                     }
                     else -> {
                         // any other unexpected exceptions considered as an error