From 1a63b8d2316b8eed7006e12c6217e0cce5d46d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E8=90=BD?= <34079036+jiluoQAQ@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:32:46 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sender=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GenshinUID/__init__.py b/GenshinUID/__init__.py index e6c8e1ce..b16facb1 100644 --- a/GenshinUID/__init__.py +++ b/GenshinUID/__init__.py @@ -42,6 +42,7 @@ 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 messages = ev.message message: List[Message] = [] sp_bot_id: Optional[str] = None @@ -89,6 +90,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, From 4048ec4f0abef39480fccf6ac58a25cb855e7647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E8=90=BD?= <34079036+jiluoQAQ@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:33:27 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sender=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GenshinUID/models.py b/GenshinUID/models.py index 2c037d45..eb26b84e 100644 --- a/GenshinUID/models.py +++ b/GenshinUID/models.py @@ -1,4 +1,4 @@ -from typing import Any, List, Literal, Optional +from typing import Any, List, Literal, Optional, Dict 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: Optional[Dict[str, Any]] = None user_pm: int = 3 content: List[Message] = [] From 119bca4a59340b22932fb311f705fdc249760065 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 02:34:17 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=9A=A8=20`pre-commit-ci`=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GenshinUID/models.py b/GenshinUID/models.py index eb26b84e..686bf118 100644 --- a/GenshinUID/models.py +++ b/GenshinUID/models.py @@ -1,4 +1,4 @@ -from typing import Any, List, Literal, Optional, Dict +from typing import Any, Dict, List, Literal, Optional from msgspec import Struct From 7a826c49487cab3dbf7e9840fa647ae894b51b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E8=90=BD?= <34079036+jiluoQAQ@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:25:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?sender=E6=B7=BB=E5=8A=A0avater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/GenshinUID/__init__.py b/GenshinUID/__init__.py index b16facb1..6738aedf 100644 --- a/GenshinUID/__init__.py +++ b/GenshinUID/__init__.py @@ -43,6 +43,7 @@ async def get_gs_msg(ev): 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 From 762bc4f5ac3f791e6ddad5167172af0689437fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wuyi=E6=97=A0=E7=96=91?= <444835641@qq.com> Date: Mon, 6 Nov 2023 21:18:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BC=98=E5=8C=96=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenshinUID/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GenshinUID/models.py b/GenshinUID/models.py index 686bf118..e85873b8 100644 --- a/GenshinUID/models.py +++ b/GenshinUID/models.py @@ -15,7 +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: Optional[Dict[str, Any]] = None + sender: Dict[str, Any] = {} user_pm: int = 3 content: List[Message] = []