From 5952b8672c878a565deeabce219639d854abb628 Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Mon, 24 Aug 2026 22:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=5Fis=5Fnoise=5Ftext=E4=B8=AD?= =?UTF-8?q?|=E8=BF=90=E7=AE=97=E7=AC=A6=E7=B1=BB=E5=9E=8B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit re.search返回re.Match|None与bool的|=报unsupported operand type(s), 三处_has_user_msg_feature赋值处re.search外加bool()包装。 --- monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.py b/monitor.py index 0035f90..4b9ccee 100644 --- a/monitor.py +++ b/monitor.py @@ -7619,7 +7619,7 @@ class MessageMonitor: _kv_pattern = re.search(r'["\']?\w+["\']?\s*[::]\s*["\']?[^"\']+["\']?', _json_content) if _kv_pattern: # ⭐ Task #1595: 检查用户消息特征 - _has_user_msg_feature = '@' in text and re.search(r'@\w+', text) + _has_user_msg_feature = '@' in text and bool(re.search(r'@\w+', text)) _has_user_msg_feature |= any(q in text for q in ['?', '?', '吗', '呢', '多少', '怎么', '如何', '哪', '什么', '几']) if _has_user_msg_feature: logger.debug(f"[ocr] 过滤器2结果: 检测到JSON但含用户消息特征,继续检查: {text[:80]!r}")