Fix unhandled BotOfflineEvent.Force

This commit is contained in:
Him188 2020-04-23 20:41:23 +08:00
parent 437f9db575
commit 1f97454b37

View File

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