From 93fad9ee1c7460017897ecfd418ee3845aa3870b Mon Sep 17 00:00:00 2001 From: RainChan <mzdluo123@foxmail.com> Date: Sun, 5 Sep 2021 17:18:58 +0800 Subject: [PATCH] #1509 try to fix bot is closed manually --- mirai-core/src/commonMain/kotlin/QQAndroidBot.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt b/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt index d82e8731a..31466dc69 100644 --- a/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt +++ b/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