From 2920279c64fe618473c5c224f028ca96cba443dc Mon Sep 17 00:00:00 2001 From: anka <1350989414@qq.com> Date: Sat, 6 Sep 2025 19:16:57 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E6=AD=A3=20QQ=20=E7=BE=A4?= =?UTF-8?q?=E6=88=90=E5=91=98=E6=98=B5=E7=A7=B0=E8=8E=B7=E5=8F=96=20(#2626?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 修正群昵称获取 * fix: 增加兜底机制 --- .../aiocqhttp/aiocqhttp_platform_adapter.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py index 7329ab603..9265fff63 100644 --- a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +++ b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py @@ -308,13 +308,20 @@ class AiocqhttpAdapter(Platform): continue at_info = await self.bot.call_action( - action="get_stranger_info", + action="get_group_member_info", + group_id=event.group_id, user_id=int(m["data"]["qq"]), + no_cache=False, ) if at_info: - nickname = at_info.get("nick", "") or at_info.get( - "nickname", "" - ) + nickname = at_info.get("card", "") + if nickname == "": + at_info = await self.bot.call_action( + action="get_stranger_info", + user_id=int(m["data"]["qq"]), + no_cache=False, + ) + nickname = at_info.get("nick", "") or at_info.get("nickname", "") is_at_self = str(m["data"]["qq"]) in {abm.self_id, "all"} abm.message.append(