fix(topic_analyzer): 话题分析处理历史消息跳过机器人列表中的消息

This commit is contained in:
SXP-Simon
2025-11-18 00:17:04 +08:00
committed by Helian Nuits
parent eb16f78b15
commit dbcf05ecb0
+18
View File
@@ -80,6 +80,15 @@ class TopicAnalyzer(BaseAnalyzer):
)
continue
# 获取发送者ID并过滤机器人消息
user_id = str(sender.get("user_id", ""))
bot_qq_ids = self.config_manager.get_bot_qq_id()
# 跳过机器人自己的消息
if bot_qq_ids and user_id in [str(qq) for qq in bot_qq_ids]:
logger.debug(f"build_prompt 过滤掉机器人QQ号: {user_id}")
continue
nickname = InfoUtils.get_user_nickname(self.config_manager, sender)
msg_time = datetime.fromtimestamp(msg.get("time", 0)).strftime("%H:%M")
@@ -314,6 +323,15 @@ class TopicAnalyzer(BaseAnalyzer):
)
continue
# 获取发送者ID并过滤机器人消息
user_id = str(sender.get("user_id", ""))
bot_qq_ids = self.config_manager.get_bot_qq_id()
# 跳过机器人自己的消息
if bot_qq_ids and user_id in [str(qq) for qq in bot_qq_ids]:
logger.debug(f"extract_text_messages 过滤掉机器人QQ号: {user_id}")
continue
nickname = InfoUtils.get_user_nickname(self.config_manager, sender)
msg_time = datetime.fromtimestamp(msg.get("time", 0)).strftime("%H:%M")