From 21bf2bf6af7fa4e761fbab87ff155d6cfd81d7f5 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Mon, 2 Dec 2024 03:35:04 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E4=BB=A5=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=87=AA=E8=BA=AB=E7=9A=84=E6=8F=90=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/groupAgent/agent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/groupAgent/agent.ts b/controller/groupAgent/agent.ts index 0fe74db..5e89e6d 100644 --- a/controller/groupAgent/agent.ts +++ b/controller/groupAgent/agent.ts @@ -8,6 +8,7 @@ const agent = async (ctx: Context.Data) => { requestId, larkCard, larkService, + appInfo, larkBody: { messageId, msgText, chatId, mentions, rawMsgText }, } = ctx const cardGender = larkCard.child("groupAgent") @@ -43,7 +44,7 @@ const agent = async (ctx: Context.Data) => { // 根据Mention,拼装原始消息 let userInput = rawMsgText for (const mention of mentions ?? []) { - if (mention.id.user_id) { + if (mention.name !== appInfo.app_name) { userInput = userInput.replace(mention.key, `@${mention.name}`) } else { userInput = userInput.replace(mention.key, "")