File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ type ChatInfoParseResult = {
2424}
2525
2626const spamPatterns = [
27- / ( t g | 电 报 | 引 流 | 群 发 | 拉 人 | 推 广 | 私 信 | 代 开 ) / i,
27+ / ( t g | 电 报 | 引 流 | 群 发 | 拉 人 | 推 广 | 广 告 | 退 订 | 私 信 | 代 开 ) / i,
2828 / ( 担 保 | 彩 票 | 投 注 | 娱 乐 | 分 红 | 工 资 | 返 点 | 返 水 ) / i,
2929 / ( 注 册 链 接 | 登 录 地 址 | 测 速 地 址 | 立 即 体 验 | 老 板 专 用 | 联 系 ) / i,
3030 / h t t p s ? : \/ \/ [ ^ \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 || [ ] ) {
You can’t perform that action at this time.
0 commit comments