From 4bef5e8313444dbcb0a84cf6fad69fb3e791ff66 Mon Sep 17 00:00:00 2001 From: Raven95676 Date: Mon, 12 May 2025 00:21:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8Dmessage=5Fstr=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sources/aiocqhttp/aiocqhttp_platform_adapter.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py index 4786b996c..0896e6ccb 100644 --- a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +++ b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py @@ -165,9 +165,7 @@ class AiocqhttpAdapter(Platform): 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 @@ -218,7 +216,7 @@ class AiocqhttpAdapter(Platform): a = None if t == "text": # 合并相邻文本段 - message_str = "".join(m["data"]["text"] for m in m_group).strip() + message_str += "".join(m["data"]["text"] for m in m_group).strip() a = ComponentTypes[t](text=message_str) # noqa: F405 abm.message.append(a) @@ -305,9 +303,7 @@ class AiocqhttpAdapter(Platform): # 兼容文本消息 message_str += f"@{nickname} " else: - abm.message.append( - At(qq=m["data"]["qq"], name="") - ) # noqa: F405 + abm.message.append(At(qq=m["data"]["qq"], name="")) # noqa: F405 except ActionFailed as e: logger.error(f"获取 @ 用户信息失败: {e},此消息段将被忽略。") except BaseException as e: