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}")