YES - This bot is designed with enterprise-grade safety mechanisms:
- Tempban: Max 3 uses per 5 minutes per user
- Mute: Max 5 uses per 5 minutes per user
- Point System: 2-moderator approval required for bans
- Mass Actions: Built-in limits (max 20 users for massban)
- Cannot ban/kick users with equal or higher roles
- Cannot target server owner
- Proper permission checks on all commands
- Role-based command restrictions
- Tempban: Maximum 7 days (10,080 minutes)
- Mute: Maximum 28 days (40,320 minutes)
- Slowmode: Maximum 6 hours (21,600 seconds)
- Point System: 100-point monthly cap with resets
- Auto-timeout: Commands that could cause server damage require confirmation
- Anti-Raid: Detects join floods and alerts staff
- Anti-Nuke: Monitors mass bans/kicks and alerts staff
- Automod: Configurable content filtering with reasonable defaults
- Auto-Dehoist: Prevents nickname hoisting automatically
- Go to https://discord.com/developers/applications
- Click "New Application"
- Name it something like "CodeVerse Moderation Bot"
- Go to "Bot" tab and click "Add Bot"
TOKEN SETTINGS:
✅ Enable "Presence Intent"
✅ Enable "Server Members Intent"
✅ Enable "Message Content Intent"
PRIVILEGES:
❌ Disable "Public Bot" (keep it private to your server)
✅ Enable "Requires OAuth2 Code Grant" (optional security)
Required Permissions Integer: 1394542166262
Or select these individual permissions:
GENERAL PERMISSIONS:
✅ View Channels
✅ Manage Channels
✅ Manage Roles
✅ Manage Server
✅ View Audit Log
✅ Read Messages/View Channels
✅ Send Messages
✅ Create Public Threads
✅ Create Private Threads
✅ Send Messages in Threads
✅ Manage Messages
✅ Manage Threads
✅ Embed Links
✅ Attach Files
✅ Read Message History
✅ Use External Emojis
✅ Add Reactions
MODERATION PERMISSIONS:
✅ Kick Members
✅ Ban Members
✅ Timeout Members
✅ Manage Nicknames
https://discord.com/api/oauth2/authorize?client_id=YOUR_BOT_CLIENT_ID&permissions=1394542166262&scope=bot%20applications.commands
Replace YOUR_BOT_CLIENT_ID with your bot's Client ID from the General Information tab.
- Name:
CodeVerse Bot - Position: ABOVE all roles it needs to moderate
- Permissions: Same as above
@Server Owner (you)
@Admin
@CodeVerse Bot ← MUST BE HERE OR HIGHER
@Moderator
@Staff
@Members
@everyone
Update your config.py:
# Your main moderation role
MODERATION_ROLE_ID = 123456789 # Replace with your mod role ID
# Alert channels
STAFF_ALERT_CHANNEL = "staff-alerts" # Channel name for raid alerts# Clone and setup
git clone https://github.com/youngcoder45/Discord-bot-in-Python.git
cd codeverse-bot
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txtCreate .env file:
DISCORD_TOKEN=your_production_bot_token
GUILD_ID=your_server_id
INSTANCE_ID=production-main# Bot will create databases automatically on first run
# Locations: data/codeverse_bot.db, data/staff_points.db, etc.python main.py# Run once after deployment
python sync_commands.py# Check bot health
?diag
# Monitor moderation stats
?modstats
# View automod settings
?automodstatus
# Check appeal system
?appeals all
# Monitor point system
?pendingbansCreate these channels for proper monitoring:
#automod-logs- Automatic moderation actions#mod-logs- Manual moderation actions#staff-alerts- Raid/nuke detection alerts#appeals- Appeal notifications (ID: 1396353386429026304)
# Configure automod features
?automod invite_links true # Block Discord invites
?automod excessive_caps true # Block excessive caps (>70%)
?automod excessive_mentions true # Block mass mentions (>5)
?automod auto_dehoist true # Remove special chars from nicknames- Monthly Reset: Automatic on 1st of each month
- Ban Threshold: 100 points
- Approval Required: 2 moderators with Ban Members permission
- Appeal System: Automatic DMs sent on moderation actions
- Immediately revoke bot token in Developer Portal
- Remove bot from server temporarily
- Check audit logs for any unauthorized actions
- Generate new token and update
.env - Review permissions before re-adding
# Stop bot
Ctrl+C
# Backup current data
cp -r data/ data_backup_$(date +%Y%m%d)
# Restore from previous backup if needed
cp -r backup/bot_data_backup_YYYYMMDD.json data/- Bot created in Discord Developer Portal
- Proper permissions configured (1394542166262)
- Bot role positioned correctly in hierarchy
-
.envfile configured with production token - Test commands in private channel first
- Backup system configured
- Slash commands synced (
python sync_commands.py) - Staff trained on new commands
- Log channels created and configured
- Automod settings reviewed and configured
- Point system tested with test user
- Appeal system tested
- Emergency procedures documented
- Monitor
?diagoutput daily - Review moderation statistics weekly
- Check appeal backlog regularly
- Update bot when new features are released
- Backup data regularly
- Point-based escalation prevents impulsive permanent bans
- Two-step approval prevents moderator abuse
- Professional appeal system maintains community trust
- Comprehensive audit trail for accountability
- Rate limiting prevents command spam/abuse
- Auto-moderation reduces manual workload
- Data persistence survives deployments/restarts
- Cannot ban server owner - hardcoded protection
- Respects role hierarchy - cannot target equal/higher roles
- Rate limited commands - prevents spam abuse
- Permission checks - every command validates permissions
- Confirmation required - destructive actions need approval
- Audit logging - all actions are tracked and logged
This bot is safer than most human moderators because it has consistent rules, cannot be emotionally compromised, and has built-in safeguards against abuse.
- Create bot → Developer Portal → Copy token
- Invite bot → Use permission integer
1394542166262 - Position role → Above roles it needs to moderate
- Configure
.env→ Add token and guild ID - Run bot →
python main.py - Sync commands →
python sync_commands.py - Test moderation → Try
?tempban @testuser 5in private channel - Configure automod →
?automod invite_links true
You're ready for production! 🚀