Add cross-channel spam tracker; refactor detection

Introduce a rapidSpamTracker to detect same messages posted across channels within a short window and return prior message IDs for cleanup. Refactor spam detection to collect scannable text from message content, embeds and attachments, simplify role-ping and link heuristics, and mark spam when a role ping + link is duplicated across channels. Update index to use the tracker/collector, delete prior spam messages, improve moderation flow (ban → kick fallback), report clearer action/error labels, and warn about missing channel permissions. Update commands display text for detection/actions and bump .env.example MIN_ACCOUNT_AGE_DAYS default to 7.
This commit is contained in:
2026-06-16 15:09:02 +12:00
parent 70d72dfef4
commit 9007f210ef
5 changed files with 182 additions and 201 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ DELETE_MESSAGE=true
# Flag role mentions when the role has at least this many members
MAX_ROLE_MENTION_SIZE=50
# Extra strict on accounts younger than this many days (0 = disabled)
MIN_ACCOUNT_AGE_DAYS=0
# Extra strict on accounts younger than this many days (0 = disabled; 7 recommended for raid protection)
MIN_ACCOUNT_AGE_DAYS=7
# Comma-separated user IDs that bypass checks on all servers (e.g. bot owner)
TRUSTED_USER_IDS=