Skip to content

A powerful, lightweight Discord moderation bot built with discord.py, featuring a robust cog-based architecture for effortless server managemen

License

Notifications You must be signed in to change notification settings

Fmasterpro27/ModGuardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Moderation Bot

A powerful Discord moderation bot built with discord.py, featuring a cog-based architecture for easy maintenance and expandability.

Features

Basic Moderation

  • !kick - Kick a user from the server
  • !ban - Ban a user from the server
  • !unban - Unban a user by their ID
  • !mute - Mute a user (with optional duration)
  • !unmute - Unmute a previously muted user

Advanced Moderation

  • !purge - Delete multiple messages at once (with optional user filter)
  • !warn - Warn a user and keep track of warnings
  • !warnings - View a user's warning history
  • !clearwarnings - Remove all warnings from a user
  • !slowmode - Set slowmode delay in the current channel
  • !lock - Lock a channel to prevent members from sending messages
  • !unlock - Unlock a previously locked channel

Configuration

  • !setlogchannel - Set the channel where moderation logs will be posted
  • !setmuterole - Set the role used for muting users
  • !createmuterole - Automatically create and set up a mute role
  • !config - View the current bot configuration

Setup

  1. Clone or download this repository
  2. Install required dependencies:
    pip install discord.py
    
  3. Open config.json and replace "YOUR_BOT_TOKEN_HERE" with your actual bot token
  4. Run the bot:
    python main.py
    

Bot Setup Instructions

After inviting the bot to your server, follow these steps to set it up:

  1. Create a mute role:

    !createmuterole
    

    This will automatically create a "Muted" role and configure its permissions in all channels.

  2. Set up a logging channel:

    !setlogchannel #mod-logs
    

    Replace #mod-logs with the channel where you want moderation actions to be logged.

  3. Verify your configuration:

    !config
    

    This will show your current bot settings.

Required Bot Permissions

When inviting the bot to your server, make sure it has the following permissions:

  • Manage Roles
  • Manage Channels
  • Kick Members
  • Ban Members
  • Manage Messages
  • View Audit Log
  • Send Messages
  • Add Reactions
  • Read Message History
  • View Channels

File Structure

discord_moderation_bot/
├── main.py              # Main bot file
├── config.json          # Bot configuration
├── warnings.json        # Warning storage
├── cogs/
│   ├── basic_moderation.py     # Basic moderation commands
│   ├── advanced_moderation.py  # Advanced moderation commands
│   ├── config.py        # Configuration commands
│   └── logging.py              # Event logging

Adding New Cogs

To add a new cog, create a Python file in the cogs directory and use the following template:

import discord
from discord.ext import commands

class YourCogName(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
    @commands.command()
    async def your_command(self, ctx):
        """Command description"""
        # Your command code here
        
async def setup(bot):
    await bot.add_cog(YourCogName(bot))

Contributing

Contributions are welcome! Feel free to submit pull requests or create issues if you find bugs or have feature suggestions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A powerful, lightweight Discord moderation bot built with discord.py, featuring a robust cog-based architecture for effortless server managemen

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages