From cf9b8c28dee73090900a92b1fcace56d69de3259 Mon Sep 17 00:00:00 2001 From: anka <1350989414@qq.com> Date: Mon, 15 Sep 2025 23:35:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=E2=9A=92=EF=B8=8F:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?at=E4=BC=9A=E8=8E=B7=E5=8F=96=E7=BE=A4=E6=98=B5=E7=A7=B0?= =?UTF-8?q?=E8=80=8C=E6=B6=88=E6=81=AF=E4=B8=8D=E4=BC=9A=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sources/aiocqhttp/aiocqhttp_platform_adapter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py index 7d3702666..8258c3357 100644 --- a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +++ b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py @@ -167,7 +167,9 @@ async def _convert_handle_notice_event(self, event: Event) -> AstrBotMessage: if "sub_type" in event: if event["sub_type"] == "poke" and "target_id" in event: - abm.message.append(Poke(qq=str(event["target_id"]), type="poke")) # noqa: F405 + abm.message.append( + Poke(qq=str(event["target_id"]), type="poke") + ) # noqa: F405 return abm @@ -182,7 +184,8 @@ async def _convert_handle_message_event( abm = AstrBotMessage() abm.self_id = str(event.self_id) abm.sender = MessageMember( - str(event.sender["user_id"]), event.sender["nickname"] + str(event.sender["user_id"]), + event.sender.get("card") or event.sender.get("nickname", "N/A"), ) if event["message_type"] == "group": abm.type = MessageType.GROUP_MESSAGE From e148e6c2ca5df2472d246d5c2f9cfd06f2448870 Mon Sep 17 00:00:00 2001 From: anka <1350989414@qq.com> Date: Thu, 18 Sep 2025 23:33:34 +0800 Subject: [PATCH 2/2] style: format code --- .../platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py index 8258c3357..47ef4848f 100644 --- a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +++ b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py @@ -167,9 +167,7 @@ async def _convert_handle_notice_event(self, event: Event) -> AstrBotMessage: if "sub_type" in event: if event["sub_type"] == "poke" and "target_id" in event: - abm.message.append( - Poke(qq=str(event["target_id"]), type="poke") - ) # noqa: F405 + abm.message.append(Poke(qq=str(event["target_id"]), type="poke")) # noqa: F405 return abm