Chat Guard is an open-source Discord moderation bot built for communities that need reliable, automated enforcement. It provides configurable protections, escalation policies, whitelisting, and auditable moderation logs.
- Bad word filtering with customisable word lists and server-specific terms
- Spam prevention for duplicate messages and rapid posting
- Mass mention control to prevent @everyone/@here abuse
- Link and invite blocking for external URLs and Discord invites
- Character limits to enforce message length constraints
- Escalation policy from warning to timed mute with configurable duration
- Granular whitelisting by member, role, or channel
- Dedicated logging of all moderation actions in real time
- Node.js 16.9.0 or later
- MongoDB instance
- Discord bot token
git clone https://github.com/hmddevs/chat-guard.git
cd chat-guard
npm installCopy .env.example to .env and set your Discord bot token, MongoDB connection URL, and bot owner IDs, then start the bot:
npm start- Invite the bot to your Discord server with Administrator permissions.
- Set up logging with
/logchannel #moderation-logs. - Enable protections: spam, bad words, link blocking via slash commands.
- Whitelist trusted roles to exempt moderators and admins from filters.
- Review logs and adjust settings as needed.
See the Getting Started Guide and Configuration Reference for details.
Full documentation is available at hmddevs.github.io/chat-guard.
- Runtime: Node.js (16.9.0+)
- Framework: discord.js v14
- Database: MongoDB with Mongoose ODM
- Architecture: Event-driven command handling
- Deployment: PM2, Docker, Heroku, or bare Node.js
Contributions are welcome. Please review the Contributing Guidelines, Code of Conduct, and Security Policy before opening a pull request.
File bugs or feature requests via GitHub Issues.
CC BY-NC-SA 4.0 with additional project-specific terms. See LICENSE for full details.
- Free for non-commercial use
- Attribution required
- Derivatives must use the same licence
- Commercial use requires permission
For commercial licensing enquiries, contact info@hmddevs.org.
- Documentation: hmddevs.github.io/chat-guard
- Bug reports: GitHub Issues
- Questions: GitHub Discussions
- Email: info@hmddevs.org
Chat Guard is based on work by Klanter.
Built by HMD Developments.