feat: 更新消息处理逻辑以排除应用自身的提及
This commit is contained in:
parent
dc958d4765
commit
21bf2bf6af
@ -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, "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user