#1509 try to fix bot is closed manually

This commit is contained in:
Karlatemp 2021-09-05 22:39:54 +08:00
parent 93fad9ee1c
commit 6cd7fa9709
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8
2 changed files with 2 additions and 3 deletions

View File

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

View File

@ -159,7 +159,7 @@ internal open class NettyNetworkHandler(
future.channel().closeFuture().addListener {
if (_state.correspondingState == State.CLOSED) return@addListener
close(it.cause())
close(NettyChannelException(cause = it.cause()))
}
return contextResult.await()