From 04328d7022701ce865d788b1c5f6f2f356553860 Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Fri, 21 Aug 2026 11:44:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Ebot=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=AF=B4=E6=98=8E=E7=A2=8E=E7=89=87=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=EF=BC=88=E6=A0=BC=E5=BC=8FX:=20json=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=AD=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/monitor.py b/monitor.py index aff281b..2f13351 100644 --- a/monitor.py +++ b/monitor.py @@ -6711,6 +6711,16 @@ class MessageMonitor: if code_keyword_count >= 2: logger.debug(f"[ocr] 过滤器3结果: 检测到代码块内容({code_keyword_count}个编程关键字),返回True") return True + # ⭐ 2026-08-21 新增:bot回复格式说明碎片拦截 + # 用户反馈 "格式2: json格式/" 这类碎片触发自动回复(内容牛头不对马嘴) + # 特征:格式编号 + 格式名称(json/php/yaml/xml等) + if re.search(r'格式\d+', text): + logger.debug(f"[ocr] 过滤器3结果: 检测到格式编号(如'格式2'),返回True") + return True + # 组合模式:格式\d+.*格式(如 "格式2: json格式/") + if re.search(r'格式\d+[::].*格式', text): + logger.debug(f"[ocr] 过滤器3结果: 检测到格式编号+格式名称组合,返回True") + return True # 文件扩展名检测(Bot md 回复中常引用文件) if re.search(r'\S+\.(txt|json|yml|yaml|md|py|js|ts|html|css|xml|java|c|cpp|h|rs|go|sh|bat|cmd)\b', text): logger.debug(f"[ocr] 过滤器3结果: 检测到文件扩展名,返回True")