diff --git a/GenshinUID/__init__.py b/GenshinUID/__init__.py index e6c8e1ce..6738aedf 100644 --- a/GenshinUID/__init__.py +++ b/GenshinUID/__init__.py @@ -42,6 +42,8 @@ async def get_gs_msg(ev): msg_id = str(ev.message_id) group_id = str(ev.group_id) self_id = str(ev.self_id) + sender = ev.sender + sender['avater'] = f'http://q1.qlogo.cn/g?b=qq&nk={user_id}&s=640' messages = ev.message message: List[Message] = [] sp_bot_id: Optional[str] = None @@ -89,6 +91,7 @@ async def get_gs_msg(ev): user_type=sp_user_type if sp_user_type else user_type, group_id=group_id, user_id=user_id, + sender=sender, content=message, msg_id=msg_id, user_pm=pm, diff --git a/GenshinUID/models.py b/GenshinUID/models.py index 2c037d45..e85873b8 100644 --- a/GenshinUID/models.py +++ b/GenshinUID/models.py @@ -1,4 +1,4 @@ -from typing import Any, List, Literal, Optional +from typing import Any, Dict, List, Literal, Optional from msgspec import Struct @@ -15,6 +15,7 @@ class MessageReceive(Struct): user_type: Literal['group', 'direct', 'channel', 'sub_channel'] = 'group' group_id: Optional[str] = None user_id: Optional[str] = None + sender: Dict[str, Any] = {} user_pm: int = 3 content: List[Message] = []