ModGuardian is an AI-powered Discord moderation bot designed to help server admins maintain a clean, spam-free, and well-managed community.
Built with Python, discord.py
, and real-time filters, it includes automatic bad word filtering, logging, mute/ban commands, and more.
- π« Bad Word Filter β Auto-deletes messages containing offensive words (customizable)
- π£οΈ Anti-Spam β Detects repeated messages to prevent spam
- π Mute/Unmute β Temporarily mute members with timed unmute
- π’ Kick & Ban β Commands for kicking and banning members
- π Event Logger β Logs message deletes and edits to a dedicated channel
- π Welcome/Leave Messages β Greets users when they join or leave
- π Role-Based Permissions β Only trusted roles can use mod tools
- π¬ Command Prefix Customization via
.env
orsettings.py
git clone https://github.com/your-username/modguardian.git
cd modguardian
BOT_TOKEN=your-discord-bot-token
COMMAND_PREFIX=!
LOG_CHANNEL_ID=123456789012345678
MUTE_ROLE_NAME=Muted
GUILD_ID=123456789012345678
Or alternatively, use settings.py
:
BOT_TOKEN = "your-discord-bot-token"
COMMAND_PREFIX = "!"
LOG_CHANNEL_ID = 123456789012345678
MUTE_ROLE_NAME = "Muted"
GUILD_ID = 123456789012345678
pip install -r requirements.txt
python bot.py
modguardian/
βββ bot.py # Main bot launcher
βββ settings.py # Config file (or use .env)
βββ requirements.txt
βββ data/
β βββ bad_words.json # List of filtered words
βββ cogs/
β βββ moderation.py # Kick, ban, mute, unmute
β βββ filters.py # Profanity + anti-spam
β βββ events.py # Joins, leaves, errors
β βββ logger.py # Message delete/edit logging
βββ utils/
β βββ bad_word_loader.py
β βββ time_utils.py
βββ assets/
βββ banner.png # Bot banner/logo
Before inviting the bot, ensure these permissions are granted:
-
Send Messages
-
Manage Messages
-
Manage Roles
-
Kick Members
-
Ban Members
-
Read Message History
-
Embed Links
- β SERVER MEMBERS INTENT
- β MESSAGE CONTENT INTENT
- β Presence Intent
- Add/remove words in
data/bad_words.json
- Modify filter behavior in
filters.py
- Customize duration logic in
time_utils.py
- Python 3.10+
- discord.py
- dotenv or settings-based config
- Async/Await architecture
This project is licensed under the APACHE License.
Feel free to fork, extend, and deploy your own version!
Pull requests and issues are welcome!
If you'd like to contribute features, translations, or ideas, just open an issue or fork the repo.
Made with β€οΈ by Youssef Osama