mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 07:00:49 +08:00
Add missed channel check
This commit is contained in:
parent
ab6e8b33eb
commit
e30f97dc2e
@ -615,6 +615,7 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
|
||||
suspend fun OutgoingPacket.sendWithoutExpect() {
|
||||
check(bot.isActive) { "bot is dead therefore can't send ${this.commandName}" }
|
||||
check(this@QQAndroidBotNetworkHandler.isActive) { "network is dead therefore can't send any packet" }
|
||||
check(channel.isOpen) { "network channel is closed" }
|
||||
logger.verbose { "Send: ${this.commandName}" }
|
||||
channel.send(delegate)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user