From 2ce653caad9884cb8344c5014ffe650d573594e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=8D=E5=90=83=E9=A2=97=E7=94=B5=E6=B1=A0=E5=90=A7?= <88479528+k1ngr4m@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:15:01 +0800 Subject: [PATCH] perf: modify the at logic in the DingTalk adapter (#3186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat 初次提交 * fix: Modify the At logic in the DingTalk adapter. * del uv.lock * 添加at_users为空判断 * 优化钉钉at的处理逻辑,不用重复判断机器人是否is_in_at_list * fix: refine handling of mentioned users in group messages --------- Co-authored-by: linyiming Co-authored-by: Soulter <905617992@qq.com> --- astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py b/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py index e61e23854..ec79c89ae 100644 --- a/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py +++ b/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py @@ -100,8 +100,11 @@ class DingtalkPlatformAdapter(Platform): abm.raw_message = message if abm.type == MessageType.GROUP_MESSAGE: - if message.is_in_at_list: - abm.message.append(At(qq=abm.self_id)) + # 处理所有被 @ 的用户(包括机器人自己,因 at_users 已包含) + if message.at_users: + for user in message.at_users: + if user.dingtalk_id: + abm.message.append(At(qq=user.dingtalk_id)) abm.group_id = message.conversation_id if self.unique_session: abm.session_id = abm.sender.user_id