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, "")