feat: 过滤掉被艾特的机器人
This commit is contained in:
parent
4a88bf6aa3
commit
dc958d4765
@ -44,7 +44,9 @@ const agent = async (ctx: Context.Data) => {
|
|||||||
let userInput = rawMsgText
|
let userInput = rawMsgText
|
||||||
for (const mention of mentions ?? []) {
|
for (const mention of mentions ?? []) {
|
||||||
if (mention.id.user_id) {
|
if (mention.id.user_id) {
|
||||||
userInput = userInput.replace(mention.key, mention.name)
|
userInput = userInput.replace(mention.key, `@${mention.name}`)
|
||||||
|
} else {
|
||||||
|
userInput = userInput.replace(mention.key, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user