Skip to content

Commit a27694e

Browse files
committed
feat: new keyword 2
1 parent f15342e commit a27694e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modules/say.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type ChatInfoParseResult = {
2424
}
2525

2626
const spamPatterns = [
27-
/(tg|||||广||)/i,
27+
/(tg|||||广|广|退||)/i,
2828
/(|||||||)/i,
2929
/(|||||)/i,
3030
/https?:\/\/[^\s]+/i,
@@ -80,7 +80,6 @@ for (const [botName, config] of Object.entries(configs)) {
8080
)
8181
return
8282
}
83-
if (config.adminChatIds?.includes(currentChat.id) && isPrivate) return
8483
if (
8584
(message.reply_to_message &&
8685
message.reply_to_message?.from?.username === bot.username) ||
@@ -89,13 +88,14 @@ for (const [botName, config] of Object.entries(configs)) {
8988
) {
9089
const textToCheck = `${message.text || ''} ${message.caption || ''}`
9190
const matchCount = spamPatterns.reduce((acc, re) => acc + (re.test(textToCheck) ? 1 : 0), 0)
92-
// 有按钮就认为是垃圾消息
91+
// 有按钮就认为是垃圾消息(让管理员可见以方便测试)
9392
if (matchCount >= 2 || message.reply_markup?.inline_keyboard) {
9493
await sendMessageToCurrentChat('`filtered`', {
9594
parse_mode: 'MarkdownV2'
9695
})
9796
return
9897
}
98+
if (config.adminChatIds?.includes(currentChat.id) && isPrivate) return
9999
const shortcut = config.list.find((el) => el.id === currentChatId)?.name
100100

101101
for (const el of config.adminChatIds || []) {

0 commit comments

Comments
 (0)