🔨 VoidSentry v2.1
A high-performance Discord security bot designed to catch and remove self-bots and malicious users who ignore server warnings. The bot monitors specific "Trap" channels and instantly bans anyone who sends a message there.
🚀 Features
- Multi-Server Support — One bot instance serves any number of servers. Each server has its own trap channels, log channel, ban reason and purge duration, managed with slash commands (no restart needed).
- Instant Detection — Real-time monitoring of multiple restricted channels.
- Auto-Ban — Immediately bans violators with zero tolerance.
- Message Purge — Deletes the banned user's recent messages across the server (24h by default, configurable per server).
- DM Notification — Sends a notification to the user before banning (best-effort, 3 s timeout, fails silently if DMs are disabled).
- Safety Net — Administrators and configurable exempt roles are never banned (their trap message is only deleted). A per-server dry-run mode reports violations without banning, and failed bans (missing permission, role hierarchy) are reported to the log channel.
- Privacy — Captured message content is cleared from the ban history after
MESSAGE_RETENTION_DAYS (default 90).
- MySQL Database — Persistent ban history storage with search and statistics.
- Detailed Ban Logs — Rich embed logs with:
- User avatar, tag, ID, and mention
- Account creation date
- Server join date
- Display name and roles
- Captured message content
- Suspicious account age warning (< 7 days old)
- Slash Commands:
/help — List all commands (built from the loaded commands, always up to date)
/setup-trap — Register the current channel as a trap for this server and post the warning
/trap-settings — View or change this server's trap channels, log channel, ban reason, purge duration, dry-run mode and exempt roles
/add-logchannel [channel] — Choose where ban logs are posted on this server (any channel, any name)
/remove-logchannel — Stop posting ban logs
/unban — Unban a user by ID (ban history is kept)
/purge-user — Bot owner only: delete all stored ban records of a user (data deletion requests)
/status — View bot uptime, statistics, and recent bans
/ban-info — Look up ban information for a user by ID (Discord ban lookup)
/bans — Ban history from database:
/bans recent [limit] — Show recent bans
/bans search <user_id> — Search bans by user ID
/bans stats — Show database statistics
- Results are limited to the current server (the bot owner can add
global:true)
- Unban from the log — Every ban log has an Unban button for administrators.
- Change log — Every settings change and unban (from a command, the log button or the dashboard) is recorded with who made it, in the
audit_log table.
- Owner alerts — When the bot cannot ban on a server (missing permission, role too low), the server owner gets at most one direct message a day about it.
- Optional web dashboard — The hosted bot at voidsentry.vercel.app has a dashboard for settings, ban history, statistics, unbans and CSV export. Its website is not open source; the API it uses is in this repository and switched off unless you configure it. Self-hosted bots are fully usable with slash commands alone (see Running without the dashboard).
- Live Status — The bot's "Watching" status rotates between your
STATUS_TEXT, the number of servers and the total number of users banned.
- Structured Logging — Pino-based logger with categories (system, security, ban, detection, command)
- Statistics Tracking — In-memory tracking of bans, detections, and DM success rate
- Branded Design — Custom logo and professional embeds
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗