Add a configuration logPreviousMessages

This commit is contained in:
Him188 2019-12-14 22:35:55 +08:00
parent f4f7e5f63c
commit 401634eb24
2 changed files with 9 additions and 1 deletions

View File

@ -226,7 +226,9 @@ internal class TIMBotNetworkHandler internal constructor(coroutineContext: Corou
return
if (!packet::class.annotations.filterIsInstance<NoLog>().any()) {
bot.logger.verbose("Packet received: $packet")
if ((packet as? BroadcastControllable)?.shouldBroadcast != false) {
bot.logger.verbose("Packet received: $packet")
}
}
when (packet) {

View File

@ -62,6 +62,12 @@ class BotConfiguration : CoroutineContext.Element {
* 验证码处理器
*/
var captchaSolver: CaptchaSolver = DefaultCaptchaSolver
/**
* 登录完成后几秒会收到好友消息的历史记录,
* 这些历史记录不会触发事件.
* 这个选项为是否把这些记录添加到日志
*/
var logPreviousMessages: Boolean = false
companion object Key : CoroutineContext.Key<BotConfiguration> {
/**