* 3. 共同群过白 (groups_in_common) * 用户与自己的共同群 >= N 个时自动通过
(client: TelegramClient, userId: number)
| 1151 | const threshold = cfg.groupsInCommon(); |
| 1152 | if (threshold < 0) return "skip"; // 禁用 |
| 1153 | |
| 1154 | try { |
| 1155 | const result = await client.invoke( |
| 1156 | new Api.users.GetFullUser({ id: userId }) |
| 1157 | ) as any; |
| 1158 | const commonChatsCount = result?.fullUser?.commonChatsCount ?? 0; |
| 1159 | if (commonChatsCount >= threshold) { |
| 1160 | wl.add(userId); |
| 1161 | log(LogLevel.INFO, `Auto-pass user ${userId} by groups_in_common (${commonChatsCount} >= ${threshold})`); |
| 1162 | return "pass"; |
| 1163 | } |
| 1164 | } catch (e) { |
| 1165 | log(LogLevel.WARN, `checkGroupsInCommon failed for ${userId}`, e); |
| 1166 | } |
| 1167 | return "skip"; |
| 1168 | } |
| 1169 | |
| 1170 | /** |
| 1171 | * 4. 关键词过白 (word_filter) |
| 1172 | * 消息包含白名单关键词 → 自动通过 |
| 1173 | * 消息包含黑名单关键词 → 自动拦截 |
| 1174 | */ |
no test coverage detected