Skip to content

roshan-kamath/Server-Guardian-DiscordBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Server Guardian+

A smart Discord moderation bot powered by Google's Gemini AI that helps keep your server clean by catching toxicity, spam, and hate speech before it becomes a problem.

Python Discord.py Gemini License

โœจ What It Does

  • ๐Ÿค– Smart Detection - Uses Google's Gemini AI to understand context and catch toxic behavior, not just keywords
  • โšก Instant Response - Catches and removes harmful messages in real-time
  • โš™๏ธ Fully Customizable - Set your own warning limits and rules that fit your community
  • ๐Ÿ“Š Transparent Logging - Every action gets logged so moderators can review what happened
  • ๐Ÿ”” Fair Warning System - Users get warnings before facing serious consequences
  • ๐Ÿ”‡ Auto-Timeout - Repeat offenders get automatically muted after too many strikes
  • ๐Ÿ“‹ Easy to Track - Clean, organized logs make moderation review simple

๐ŸŽฏ How It Works

The bot watches your server channels and runs messages through Gemini AI to detect problematic content. When something gets flagged, it immediately deletes the message, warns the user, and logs everything for your mod team. After a configurable number of warnings, users get auto-muted to give everyone a breather.

Demo

Real example: The bot caught a vulgar word, deleted it, and warned the userโ€”all automatically

๐Ÿš€ Quick Setup

What You'll Need

Getting Started

  1. Download the code
   git clone https://github.com/yourusername/server-guardian-plus.git
   cd server-guardian-plus
  1. Install what it needs
   pip install -r requirements.txt
  1. Add your keys

    Create a .env file and add:

   DISCORD_TOKEN=your_discord_bot_token
   GEMINI_API_KEY=your_gemini_api_key
  1. Tweak the settings (optional)

    Open config.json and adjust to your liking:

   {
     "warning_threshold": 3,
     "mute_duration": 600,
     "log_channel_id": "your_log_channel_id",
     "moderation_enabled": true
   }
  1. Fire it up!
   python bot.py

๐Ÿ“ Settings You Can Change

config.json Options

Setting What It Does Default
warning_threshold Warnings before auto-mute kicks in 3
mute_duration How long mutes last (in seconds) 600 (10 min)
log_channel_id Where to send mod logs -
moderation_enabled Turn auto-mod on/off true
toxicity_threshold How confident the AI needs to be (0-1) 0.7

๐ŸŽฎ Commands

Command What It Does Who Can Use It
!warnings @user See how many warnings someone has Moderators
!clearwarnings @user Reset someone's warnings Admins
!config Check current settings Admins
!toggle Turn moderation on/off Admins

๐Ÿ”ง Built With

  • Python 3.8+ - The backbone of the bot
  • discord.py 2.0+ - For Discord integration
  • Google Gemini API - The AI brain doing the heavy lifting
  • python-dotenv - Keeps your secrets safe
  • JSON - Simple data storage (can upgrade to a database later)

๐Ÿ“‚ What's Inside

server-guardian-plus/
โ”‚
โ”œโ”€โ”€ bot.py                 # The main bot code
โ”œโ”€โ”€ cogs/
โ”‚   โ”œโ”€โ”€ moderation.py      # Moderation commands and logic
โ”‚   โ””โ”€โ”€ logging.py         # Handles all the logging
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ ai_moderator.py    # Gemini API integration
โ”‚   โ””โ”€โ”€ database.py        # Tracks warnings and user data
โ”œโ”€โ”€ config.json            # Your settings
โ”œโ”€โ”€ requirements.txt       # Everything the bot needs to run
โ”œโ”€โ”€ .env.example          # Template for your API keys
โ””โ”€โ”€ README.md             # You're reading it!

๐Ÿค Want to Contribute?

I'd love your help making this better! Here's how:

  1. Fork this repo
  2. Create your feature branch (git checkout -b feature/CoolNewFeature)
  3. Commit your changes (git commit -m 'Added something cool')
  4. Push it up (git push origin feature/CoolNewFeature)
  5. Open a Pull Request and let's chat!

๐Ÿ“‹ What's Next

Here's what I'm thinking about adding:

  • Support for multiple languages
  • Proper database (PostgreSQL or MongoDB)
  • Web dashboard with stats and analytics
  • Custom word filters you can manage
  • User appeal system for false positives
  • Image and media moderation

โš ๏ธ Fair Warning

This bot uses AI, which is pretty smart but not perfect. You should still have human moderators review flagged content regularly. Think of this as a helpful assistant, not a replacement for your mod team.

๐Ÿ“„ License

This project is licensed under the MIT License - basically, use it however you want! See the LICENSE file for the legal stuff.

๐Ÿ™ Thanks To

  • Discord.py - For making Discord bots actually doable
  • Google Gemini - For the AI magic
  • Everyone who tested this and gave feedback

๐Ÿ“ง Let's Connect

Want to chat about the project or have questions?

LinkedIn: www.linkedin.com/in/roshan-kamath-9806b337b


โญ If this helped your server, drop a star! It means a lot and keeps me motivated to improve it.

About

๐Ÿ›ก๏ธ An AI-powered Discord moderation bot that automatically detects and handles toxicity, spam, and hate speech using Gemini's API. Features configurable warning systems, auto-moderation actions, and comprehensive logging for server safety.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages