A powerful, feature-rich Discord moderation bot with advanced automod, comprehensive logging, and user-friendly configuration.
A public available hosted instance of Rainbot can be invited using:
- Manual Moderation: Kick, ban, mute, warn, and tempban commands
- Advanced Auto-moderation: Spam detection, invite blocking, bad word filtering
- NSFW Detection: AI-powered image analysis
- Mass Mention Protection: Prevent mention spam
- Caps Lock Detection: Automatic moderation of excessive caps
- Duplicate Message Detection: Prevent message spam
- Comprehensive Logging: Track all server activity
- Moderation Logs: Record all moderation actions
- User Activity: Member joins, leaves, role changes
- Message Logs: Edits, deletions, and reactions
- Voice Activity: Join, leave, move, and mute events
- Server Changes: Role, channel, and server updates
- Interactive Setup: User-friendly setup wizard
- Permission Levels: Granular permission system
- Custom Commands: Create server-specific commands
- Reaction Roles: Easy role assignment system
- Giveaways: Built-in giveaway system
- Tags System: Quick response system
- Rich Embeds: Beautiful, informative responses
- Interactive Menus: Easy-to-use interface
- Smart Help System: Context-aware help commands
- Error Handling: User-friendly error messages
- Statistics: Detailed bot and server statistics
- Python 3.8 or higher
- MongoDB database
- Discord Bot Token
-
Clone the repository
git clone https://github.com/fourjr/rainbot.git cd rainbot
-
Use the deployment script (recommended)
chmod +x deploy.sh ./deploy.sh install
-
Or install manually
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Set up environment variables Create a
.env
file in the root directory:token=your_discord_bot_token_here mongo=your_mongodb_connection_string owners=comma,separated,discord_user_ids # e.g., 123,456 error_channel_id= owner_log_channel_id= guild_join_channel_id= guild_remove_channel_id= dev_guild_id= DEBUG=false LOG_LEVEL=INFO ALLOW_EXEC_IN_PROD=false
-
Run the bot
./deploy.sh run # Or manually: python bot.py
The setup system provides an interactive way to configure rainbot for your server. Here's what each setup command does:
Shows the main setup menu with all available options:
- Quick Setup - Basic configuration
- Advanced Setup - Detailed configuration
- Auto-moderation - Configure automod
- Logging - Set up logging channels
- Permissions - Configure permission levels
- View Current - See current settings
A step-by-step wizard that guides you through basic configuration:
- Command Prefix: Choose your preferred prefix (e.g.,
!
,?
,>
,r!
) - Mute Role: Automatically creates a "Muted" role with proper permissions
- Moderation Logs: Creates a channel for logging moderation actions
What it configures:
- Sets the command prefix for your server
- Creates and configures a mute role with proper channel permissions
- Sets up a moderation log channel
- Configures basic logging for bans, kicks, mutes, and warnings
Interactive setup for automatic moderation features:
Available Features:
- ๐ Spam Detection: Prevents message spam
- ๐ Invite Links: Blocks Discord invite links
- ๐คฌ Bad Words: Filters inappropriate content
- ๐ข Mass Mentions: Prevents mention spam
- ๐ Caps Lock: Moderates excessive caps
- ๐ผ๏ธ NSFW Images: Detects inappropriate images
- ๐ Duplicate Messages: Prevents message repetition
Configure channels for different types of logging:
Log Types:
- ๐ฅ Member Joins/Leaves: Track member activity
- ๐จ Moderation Actions: Log all moderation
- ๐ฌ Message Edits/Deletes: Track message changes
- ๐ญ Role Changes: Monitor role updates
- ๐ Voice Activity: Track voice channel activity
- ๐ก๏ธ Server Updates: Monitor server changes
Configure permission levels for your server:
Permission Levels:
- Level 0: Everyone - Basic commands
- Level 1: Helper - Basic moderation
- Level 2: Moderator - Kick, warn, mute
- Level 3: Senior Moderator - Ban, tempban
- Level 4: Admin - All moderation
- Level 5: Senior Admin - Server management
- Level 6: Server Manager - Full control
How to set permissions:
!setpermlevel <level> <role>
Example: !setpermlevel 2 @Moderator
!setup
- Interactive setup wizard!setup quick
- Quick basic setup!setup automod
- Configure auto-moderation!setup logging
- Set up logging channels!setup permissions
- Configure permission levels!viewconfig
- View current configuration!importconfig <url>
- Import configuration from URL!resetconfig
- Reset to default settings
!kick <user> [reason]
- Kick a user!ban <user> [duration] [reason]
- Ban a user!tempban <user> <duration> [reason]
- Temporarily ban a user!mute <user> <duration> [reason]
- Mute a user!warn <user> <reason>
- Warn a user!unban <user_id>
- Unban a user!unmute <user>
- Unmute a user
!help [command]
- Show help information!about
- Bot information and statistics!server
- Server information!user <user>
- User information!ping
- Check bot latency!stats
- Detailed bot statistics!invite
- Get bot invite link
!role <user> <role>
- Add/remove role from user!reactionrole
- Set up reaction roles!autorole <role>
- Set automatic role assignment
!gstart <duration> <winners> <prize>
- Start a giveaway!gend <message_id>
- End a giveaway!greroll <message_id>
- Reroll giveaway winners
- Level 0: Everyone - Basic commands
- Level 1: Helper - Basic moderation
- Level 2: Moderator - Kick, warn, mute
- Level 3: Senior Moderator - Ban, tempban
- Level 4: Admin - All moderation
- Level 5: Senior Admin - Server management
- Level 6: Server Manager - Full control
- Spam Detection: Prevent message spam
- Invite Blocking: Block Discord invite links
- Bad Word Filter: Filter inappropriate content
- Mass Mentions: Prevent mention spam
- Caps Lock: Moderate excessive caps
- NSFW Detection: Detect inappropriate images
- Duplicate Messages: Prevent message repetition
- Moderation Logs: All moderation actions
- User Logs: Member joins, leaves, role changes
- Message Logs: Message edits, deletions
- Voice Logs: Voice channel activity
- Server Logs: Server configuration changes
Create server-specific commands with variables:
!addcommand welcome Welcome {user} to {server}!
Set up automatic role assignment:
!reactionrole add ๐ฎ Gamer
Manage bad word filtering:
!filter add badword
!filter remove badword
Set up quick response templates:
!setcanned welcome Welcome to our server!
rainbot/
โโโ bot.py # Main bot file
โโโ config.py # Configuration settings
โโโ requirements.txt # Python dependencies
โโโ deploy.sh # Deployment script
โโโ cogs/ # Bot modules
โ โโโ moderation.py # Moderation commands
โ โโโ utils.py # Utility commands
โ โโโ setup.py # Setup commands
โ โโโ logs.py # Logging system
โ โโโ ...
โโโ ext/ # Extensions
โ โโโ command.py # Command decorators
โ โโโ database.py # Database management
โ โโโ utility.py # Utility functions
โ โโโ ...
โโโ stubs/ # Type stubs
- Create a new cog in the
cogs/
directory - Use the
@command()
decorator for commands - Add proper error handling and user feedback
- Update documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Servers: 1000+
- Users: 500,000+
- Commands Processed: 1M+
- Uptime: 99.9%
- Invite Bot - Add to your server
- Support Server - Get help and support
- Documentation - Detailed guides
- GitHub - Source code
This project is licensed under the MIT License - see the LICENSE file for details.
- discord.py - Discord API wrapper
- MongoDB - Database
- Rich - Beautiful terminal output
- TensorFlow - AI/ML capabilities
If you need help:
- Check the documentation
- Join our support server
- Create an issue on GitHub