Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加sender字段传递用户数据 #598

Merged
merged 5 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GenshinUID/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion GenshinUID/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Literal, Optional
from typing import Any, Dict, List, Literal, Optional

from msgspec import Struct

Expand All @@ -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] = []

Expand Down
Loading