diff --git a/astrbot/core/platform/astrbot_message.py b/astrbot/core/platform/astrbot_message.py index e7bd4bd9c..54ed51e80 100644 --- a/astrbot/core/platform/astrbot_message.py +++ b/astrbot/core/platform/astrbot_message.py @@ -62,6 +62,8 @@ class AstrBotMessage: raw_message: object timestamp: int # 消息时间戳 + be_at_wxid: List[str] # gewechat用的群组内at信息,用于机器人获取被at的wxid + def __init__(self) -> None: self.timestamp = int(time.time()) diff --git a/astrbot/core/platform/sources/gewechat/client.py b/astrbot/core/platform/sources/gewechat/client.py index ccecc0c71..fb1f13663 100644 --- a/astrbot/core/platform/sources/gewechat/client.py +++ b/astrbot/core/platform/sources/gewechat/client.py @@ -152,9 +152,13 @@ class SimpleGewechatClient: # at # content = content.split('\u2005')[1] content = re.sub(r"@[^\u2005]*\u2005", "", content) + abm.be_at_wxid = re.findall(r')',d["MsgSource"]) + abm.group_id = from_user_name # at msg_source = d["MsgSource"] + + if ( f"" in msg_source or f"" in msg_source