From 967e9439157de6740f4eea369fc66ef2880c857d Mon Sep 17 00:00:00 2001 From: Guimc Date: Wed, 10 Jul 2024 19:35:41 +0800 Subject: [PATCH] update --- .../lgzbot/listener/message/MessageFilter.kt | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt b/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt index 1ae3840..7414197 100644 --- a/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt +++ b/src/main/kotlin/ltd/guimc/lgzbot/listener/message/MessageFilter.kt @@ -96,6 +96,8 @@ object MessageFilter { memberReviewing.get(e.sender.id) + "\n" + textMessage.replace("\n", "") ) if (memberReviewing.get(e.sender.id)?.let { RegexUtils.countLines(it) }!! >= 5) { + logger.info("结束 ${e.sender.id} 的追溯检查") + memberReviewing.remove(e.sender.id) if (memberReviewing.get(e.sender.id)!!.length <= stringLength) { memberReviewing.remove(e.sender.id) return @@ -116,8 +118,23 @@ object MessageFilter { historyMessage[e.sender.id]?.clear() memberVl[e.sender.id] = .0 messagesHandled++ + } else if (predictedResult[1] - predictedResult[0] >= 0.22) { + e.group.mute(e.sender, "追溯检查 (模型)") + muted = true + recalledMessage++ + e.message.recall() + try { + historyMessage[e.sender.id]?.forEach { + recalledMessage++ + it.recall() + sleep(100) + } + } catch (_: Exception) { + } + historyMessage[e.sender.id]?.clear() + memberVl[e.sender.id] = .0 + messagesHandled++ } - memberReviewing.remove(e.sender.id) } } @@ -184,6 +201,7 @@ object MessageFilter { setVl(e.sender.id, 99.0) muted = true } else if (abs(predictedResult[1] / predictedResult[0]) >= 2.5) { + logger.info("开始 ${e.sender.id} 的追溯检查") memberReviewing.put(e.sender.id, textMessage.replace("\n", "")) } else { // 长消息误判率较低,除非过长