Protect your Discord server with enterprise-grade security features
Quick Start • Features • Installation • Documentation
PROT7 is a comprehensive Discord security bot designed to protect servers from spam, raids, and malicious activities. Built with Python and featuring an advanced admin control panel, PROT7 provides real-time threat detection, automated moderation, and detailed security analytics.
Key Highlights
- Real-time Protection: Advanced anti-spam and raid detection
- Automated Moderation: Smart content filtering and user management
- Admin Control Panel: Comprehensive command-line management interface
- Database Analytics: SQLite-powered logging and statistics
- Slash Commands: Modern Discord interface with intuitive commands
- Hot Configuration: Live config reloading without restarts
Prerequisites
- OS: Debian 11+ / Ubuntu 20.04+ (recommended)
- Python: 3.8 or higher
- Memory: 512MB+ RAM available
- Storage: 1GB+ free disk space
- Network: Stable internet connection
pip3 install discord.py asyncio sqlite3Installation Steps
Upload all files to your server root directory:
prot7.py(main bot application)prot7adm.py(admin control panel)prot7.env(environment configuration)
Edit prot7.env with your Discord bot token:
DISCORD_TOKEN=your_actual_bot_token_herechmod +x prot7.py prot7adm.py
chmod 600 prot7.env# Method 1: Direct execution
python3 prot7.py
# Method 2: Using admin panel
python3 prot7adm.pySecurity Features
- Smart Detection: AI-powered spam pattern recognition
- Progressive Punishment: Escalating consequences for repeat offenders
- Rate Limiting: Message frequency and content analysis
- Mention Protection: Prevents mass mention abuse
- Join Rate Monitoring: Detects suspicious member influx
- Account Age Verification: Filters new/suspicious accounts
- Automatic Response: Real-time threat mitigation
- Alert System: Instant notifications for security events
- Word Filtering: Customizable blocked word lists
- Message Analysis: Advanced content scanning
- Auto-Deletion: Instant removal of violating content
- User Notifications: Automated warning system
Moderation Tools
/security_status- Real-time security dashboard/ban <user> [reason]- Advanced user banning with logging/kick <user> [reason]- User removal with audit trail/setup- Automated server configuration
!p7 status- Bot status and statistics!p7 lockdown [channel]- Emergency channel lockdown!p7 unlock [channel]- Channel access restoration!p7 reload- Hot configuration reload
- Timeout Management: Temporary user restrictions
- Bulk Actions: Mass message and user management
- Role Integration: Permission-based command access
- Audit Logging: Comprehensive action tracking
Admin Control Panel
- Real-time Monitoring: Live bot status and metrics
- Process Management: Start, stop, restart bot operations
- Resource Monitoring: CPU, memory, and performance stats
- Log Viewing: Real-time log analysis and filtering
- Security Logs: Browse and export security events
- Message History: Search and analyze user messages
- User Tracking: Comprehensive user activity logs
- Statistics Export: CSV export for external analysis
- Module Control: Enable/disable bot features
- Word Lists: Manage blocked content filters
- Channel Setup: Configure logging and alert channels
- Role Management: Set up admin and moderator roles
- Database Cleanup: Automated data optimization
- Log Rotation: Automatic log file management
- Backup Systems: Data export and archival
- Performance Tuning: System optimization tools
Server Setup
-
Create Bot Directory
mkdir /opt/prot7 cd /opt/prot7 -
Upload Files
- Transfer all bot files to
/opt/prot7/ - Ensure proper file permissions
- Transfer all bot files to
-
Install Dependencies
pip3 install -r requirements.txt
Create service file:
sudo nano /etc/systemd/system/prot7.serviceService configuration:
[Unit]
Description=PROT7 Discord Security Bot
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=10
User=prot7
WorkingDirectory=/opt/prot7
ExecStart=/usr/bin/python3 /opt/prot7/prot7.py
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable prot7.service
sudo systemctl start prot7.service
sudo systemctl status prot7.serviceDiscord Configuration
Required Discord permissions:
- Text Permissions: Send Messages, Manage Messages, Read Message History
- Moderation: Kick Members, Ban Members, Timeout Members
- Management: Manage Channels, Manage Roles
- Advanced: Use Slash Commands, Embed Links
-
Run Setup Command
/setupThis automatically creates:
- Security log channels
- Moderation log channels
- Admin and moderator roles
- Basic permissions structure
-
Assign Roles
- Give
Prot7 Adminrole to server administrators - Give
Prot7 Moderatorrole to trusted moderators
- Give
-
Configure Channels
- Set up dedicated security logging channels
- Configure alert notification channels
- Adjust channel permissions as needed
Configuration Reference
{
"prefix": "!p7",
"admin_roles": ["role_id_1", "role_id_2"],
"mod_roles": ["role_id_3", "role_id_4"],
"log_channel": "channel_id",
"mod_log_channel": "channel_id",
"security_alert_channel": "channel_id",
"blocked_words": ["spam", "scam", "phishing"],
"modules": {
"anti_spam": true,
"auto_mod": true,
"channel_guard": true,
"user_tracking": true,
"advanced_audit": true,
"raid_protection": true
},
"security": {
"min_account_age_days": 7,
"spam_threshold": 8,
"max_mentions": 5,
"mod_commands_require_reason": true,
"dm_on_moderation": true,
"auto_timeout_spam": true
}
}# Discord Bot Configuration
DISCORD_TOKEN=your_discord_bot_token_here
# Optional: Database Configuration
DATABASE_PATH=prot7.db
# Optional: Logging Configuration
LOG_LEVEL=INFO
LOG_FILE=prot7.logDatabase Schema
- messages: User message history and content analysis
- security_events: Security incidents with severity levels
- users: User profiles and behavioral tracking
- advanced_audit: Detailed audit trails for all actions
- server_stats: Server analytics and growth metrics
- moderation_actions: Complete moderation history
- Messages: 90 days (configurable)
- Security Events: 1 year (configurable)
- Audit Logs: Permanent (with cleanup tools)
- Statistics: Permanent (aggregated monthly)
Monitoring & Analytics
prot7.log- Main application logsprot7_bot.log- Bot process outputsecurity.log- Security event detailsadmin.log- Admin panel activity
Access via admin panel:
python3 prot7adm.py
# Select: System Status & StatisticsKey metrics include:
- Security Events: Real-time threat detection
- User Activity: Message and interaction patterns
- Server Health: Performance and resource usage
- Moderation Stats: Action frequency and effectiveness
Common Issues
Symptoms: Bot fails to connect or crashes on startup Solutions:
- Verify Discord token in
prot7.env - Check Python version:
python3 --version - Install missing dependencies:
pip3 install -r requirements.txt - Review logs:
tail -f prot7.log
Symptoms: Commands fail or features don't work Solutions:
- Ensure bot has required Discord permissions
- Check bot role hierarchy (must be above moderated roles)
- Verify file permissions:
ls -la prot7* - Review Discord audit log for permission issues
Symptoms: Data not saving or corruption errors Solutions:
- Check disk space:
df -h - Verify write permissions in bot directory
- Run database maintenance via admin panel
- Restore from backup if available
Symptoms: Slow response times or high resource usage Solutions:
- Monitor system resources:
htop - Run database vacuum via admin panel
- Clear old logs and data
- Consider server upgrade if needed
Maintenance
- Weekly: Review security logs and statistics
- Monthly: Clean up old database records
- Quarterly: Update bot and dependencies
- As Needed: Backup configuration and data
python3 prot7adm.py
# Navigate to: Maintenance ToolsAvailable tools:
- Database cleanup and optimization
- Log file management and rotation
- Data export and backup
- Performance monitoring and tuning
- Check the documentation first
- Report bugs on GitHub
- Contact: support@prot7.bot
We welcome contributions!
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
PROT7 is licensed under the MIT License
Created by the PROT7 Team
Protecting Discord communities worldwide
Security Notice: Keep your Discord bot token secure and never share it publicly. Regularly monitor your security logs and update the bot to ensure optimal protection.