fix(chat): 增强消息查找功能并添加未读消息自动清理机制
- 重构 `_find_message_by_id` 方法,支持多种消息ID格式和模糊匹配 - 在动作执行后自动清理未读消息,防止消息堆积 - 为 `reply` 动作添加目标消息查找失败时的降级处理 - 将消息计数和关系查询方法改为异步调用以保持一致性
This commit is contained in:
@@ -1651,7 +1651,7 @@ class DefaultReplyer:
|
||||
user_id = user_info.get("user_id", "unknown")
|
||||
|
||||
# 从数据库获取关系数据
|
||||
relationship_data = relationship_tracker._get_user_relationship_from_db(user_id)
|
||||
relationship_data = await relationship_tracker._get_user_relationship_from_db(user_id)
|
||||
if relationship_data:
|
||||
relationship_text = relationship_data.get("relationship_text", "")
|
||||
relationship_score = relationship_data.get("relationship_score", 0.3)
|
||||
|
||||
Reference in New Issue
Block a user