feat:可以关闭回复前黑话自动提取

This commit is contained in:
SengokuCola
2025-12-18 17:34:32 +08:00
parent 11dd9ece13
commit 216c51d7a2
5 changed files with 43 additions and 11 deletions

View File

@@ -188,6 +188,13 @@ class ExpressionLearner:
if not context:
continue
# 过滤掉包含 SELF 的内容(不学习)
if "SELF" in (situation or "") or "SELF" in (style or "") or "SELF" in context:
logger.info(
f"跳过包含 SELF 的表达方式: situation={situation}, style={style}, source_id={source_id}"
)
continue
filtered_expressions.append((situation, style, context))
learnt_expressions = filtered_expressions
@@ -689,6 +696,11 @@ class ExpressionLearner:
if not content:
continue
# 过滤掉包含 SELF 的黑话,不学习
if "SELF" in content:
logger.info(f"跳过包含 SELF 的黑话: {content}")
continue
# 检查是否包含机器人名称
if contains_bot_self_name(content):
logger.info(f"跳过包含机器人昵称/别名的黑话: {content}")