Преглед на файлове

#1509 try to fix bot is closed manually

RainChan преди 4 години
родител
ревизия
b822c045d5
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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