feat: 为bot回复添加关键词记录 (Task #1556)
This commit is contained in:
+10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user