mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 23:20:09 +08:00
Implement Packet.NoLog
This commit is contained in:
parent
a797dac5ba
commit
1b8626df13
@ -449,15 +449,18 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
|||||||
// highest priority: pass to listeners (attached by sendAndExpect).
|
// highest priority: pass to listeners (attached by sendAndExpect).
|
||||||
if (packet != null && (bot.logger.isEnabled || logger.isEnabled)) {
|
if (packet != null && (bot.logger.isEnabled || logger.isEnabled)) {
|
||||||
when (packet) {
|
when (packet) {
|
||||||
is GroupMessage -> bot.logger.verbose(
|
is Packet.NoLog -> {
|
||||||
|
// nothing to do
|
||||||
|
}
|
||||||
|
is GroupMessage -> bot.logger.verbose {
|
||||||
"[${packet.group.name}(${packet.group.id})] ${packet.senderName}(${packet.sender.id}) -> ${packet.message.toString()
|
"[${packet.group.name}(${packet.group.id})] ${packet.senderName}(${packet.sender.id}) -> ${packet.message.toString()
|
||||||
.singleLine()}"
|
.singleLine()}"
|
||||||
)
|
}
|
||||||
is FriendMessage -> bot.logger.verbose(
|
is FriendMessage -> bot.logger.verbose {
|
||||||
"${packet.sender.nick}(${packet.sender.id}) -> ${packet.message.toString().singleLine()}"
|
"${packet.sender.nick}(${packet.sender.id}) -> ${packet.message.toString().singleLine()}"
|
||||||
)
|
}
|
||||||
is Event -> bot.logger.verbose("Event: ${packet.toString().singleLine()}")
|
is Event -> bot.logger.verbose { "Event: ${packet.toString().singleLine()}" }
|
||||||
else -> logger.verbose("Event: ${packet.toString().singleLine()}")
|
else -> logger.verbose { "Event: ${packet.toString().singleLine()}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user