feat: 为bot回复添加关键词记录 (Task #1556)

This commit is contained in:
youpaishidifu
2026-08-18 12:48:59 +08:00
parent ad88cfbb8f
commit 02b0c47c52
+10
View File
@@ -7115,6 +7115,16 @@ class MessageMonitor:
# 记录到消息历史数据库
self._msg_history.record_bot_reply(platform, text.strip())
# ⭐ Task #1556: 记录bot回复的关键词得分
if self._keyword_scorer:
try:
keywords = self._keyword_scorer.extract_keywords(text.strip())
self._keyword_scorer.record_message_score(
platform, text.strip(), keywords, 0, [], is_new=False
)
except Exception as e:
logger.debug(f"[{platform}] 关键词记录失败: {e}")
# 记录回复到去重集(与 _paste_and_send 一致)
reply_text = text.strip()
self._replied_texts.add(reply_text)