perf: modify the at logic in the DingTalk adapter (#3186)
* 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 <linyiming@example.com> Co-authored-by: Soulter <905617992@qq.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user