mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-15 04:50:11 +08:00
Remove redundant suspension in BotOfflineEventMonitorImpl
This commit is contained in:
parent
e10155a7b3
commit
0d339c7303
@ -11,7 +11,6 @@ package net.mamoe.mirai.internal.network.components
|
|||||||
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.CoroutineStart
|
import kotlinx.coroutines.CoroutineStart
|
||||||
import kotlinx.coroutines.coroutineScope
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.mamoe.mirai.event.ConcurrencyKind
|
import net.mamoe.mirai.event.ConcurrencyKind
|
||||||
import net.mamoe.mirai.event.EventPriority
|
import net.mamoe.mirai.event.EventPriority
|
||||||
@ -43,7 +42,7 @@ internal interface BotOfflineEventMonitor {
|
|||||||
|
|
||||||
internal data class BotClosedByEvent(
|
internal data class BotClosedByEvent(
|
||||||
val event: BotOfflineEvent,
|
val event: BotOfflineEvent,
|
||||||
override val message: String? = "Bot is closed by event '$event'."
|
override val message: String? = "Bot is closed by event '$event'.",
|
||||||
) : NetworkException(false)
|
) : NetworkException(false)
|
||||||
|
|
||||||
internal class BotOfflineEventMonitorImpl : BotOfflineEventMonitor {
|
internal class BotOfflineEventMonitorImpl : BotOfflineEventMonitor {
|
||||||
@ -55,7 +54,7 @@ internal class BotOfflineEventMonitorImpl : BotOfflineEventMonitor {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun onEvent(event: BotOfflineEvent) = coroutineScope {
|
private fun onEvent(event: BotOfflineEvent) {
|
||||||
val bot = event.bot.asQQAndroidBot()
|
val bot = event.bot.asQQAndroidBot()
|
||||||
val network = bot.network
|
val network = bot.network
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user