feat: 更新消息处理逻辑以排除应用自身的提及
This commit is contained in:
parent
dc958d4765
commit
21bf2bf6af
@ -8,6 +8,7 @@ const agent = async (ctx: Context.Data) => {
|
|||||||
requestId,
|
requestId,
|
||||||
larkCard,
|
larkCard,
|
||||||
larkService,
|
larkService,
|
||||||
|
appInfo,
|
||||||
larkBody: { messageId, msgText, chatId, mentions, rawMsgText },
|
larkBody: { messageId, msgText, chatId, mentions, rawMsgText },
|
||||||
} = ctx
|
} = ctx
|
||||||
const cardGender = larkCard.child("groupAgent")
|
const cardGender = larkCard.child("groupAgent")
|
||||||
@ -43,7 +44,7 @@ const agent = async (ctx: Context.Data) => {
|
|||||||
// 根据Mention,拼装原始消息
|
// 根据Mention,拼装原始消息
|
||||||
let userInput = rawMsgText
|
let userInput = rawMsgText
|
||||||
for (const mention of mentions ?? []) {
|
for (const mention of mentions ?? []) {
|
||||||
if (mention.id.user_id) {
|
if (mention.name !== appInfo.app_name) {
|
||||||
userInput = userInput.replace(mention.key, `@${mention.name}`)
|
userInput = userInput.replace(mention.key, `@${mention.name}`)
|
||||||
} else {
|
} else {
|
||||||
userInput = userInput.replace(mention.key, "")
|
userInput = userInput.replace(mention.key, "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user