fix:总之修复bug
This commit is contained in:
@@ -656,9 +656,9 @@ class DefaultReplyer:
|
||||
chat_id = chat_stream.stream_id
|
||||
is_group_chat = bool(chat_stream.group_info)
|
||||
platform = chat_stream.platform
|
||||
user_id = reply_message.get("user_id","")
|
||||
|
||||
if user_id:
|
||||
if reply_message:
|
||||
user_id = reply_message.get("user_id","")
|
||||
person = Person(platform=platform, user_id=user_id)
|
||||
person_name = person.person_name or user_id
|
||||
sender = person_name
|
||||
|
||||
@@ -307,7 +307,7 @@ class Person:
|
||||
logger.error(f"同步用户 {self.person_id} 信息到数据库时出错: {e}")
|
||||
|
||||
def build_relationship(self,points_num=3):
|
||||
print(self.person_name,self.nickname,self.platform,self.is_known)
|
||||
# print(self.person_name,self.nickname,self.platform,self.is_known)
|
||||
|
||||
|
||||
if not self.is_known:
|
||||
@@ -374,6 +374,8 @@ class Person:
|
||||
if points_text:
|
||||
points_info = f"你还记得ta最近做的事:{points_text}"
|
||||
|
||||
if not (nickname_str or attitude_info or neuroticism_info or points_info):
|
||||
return ""
|
||||
relation_info = f"{self.person_name}:{nickname_str}{attitude_info}{neuroticism_info}{points_info}"
|
||||
|
||||
return relation_info
|
||||
|
||||
@@ -358,8 +358,6 @@ class RelationshipManager:
|
||||
if msg.get("user_id") == "system":
|
||||
continue
|
||||
try:
|
||||
if not is_person_known(user_id=msg.get("user_id"), platform=msg.get("chat_info_platform")):
|
||||
continue
|
||||
msg_person = Person(user_id=msg.get("user_id"), platform=msg.get("chat_info_platform"))
|
||||
except Exception as e:
|
||||
logger.error(f"初始化Person失败: {msg}")
|
||||
@@ -392,8 +390,6 @@ class RelationshipManager:
|
||||
# 确保 original_name 和 mapped_name 都不为 None
|
||||
if original_name is not None and mapped_name is not None:
|
||||
readable_messages = readable_messages.replace(f"{original_name}", f"{mapped_name}")
|
||||
|
||||
print(name_mapping)
|
||||
|
||||
await self.get_points(
|
||||
readable_messages=readable_messages, name_mapping=name_mapping, timestamp=timestamp, person=person)
|
||||
|
||||
Reference in New Issue
Block a user