What are Discord Webhooks?
Discord webhooks allow external applications to post messages to Discord channels automatically. Mythic Framework uses webhooks to send structured, rich embeds with server activity logs.Real-Time Logging
Get instant notifications of important server events
Rich Embeds
Color-coded, formatted messages with detailed information
Centralized Monitoring
All logs in one place for easy staff monitoring
Easy Setup
Simple configuration, works out of the box
Creating Discord Webhooks
Create or Select Discord Server
You need a Discord server where you have Manage Webhooks permission.
Navigate to Channel Settings
- Right-click the channel where you want logs
- Click “Edit Channel”
- Go to “Integrations” tab
- Click “Webhooks”
Create New Webhook
- Click “New Webhook” or “Create Webhook”
- Customize the webhook:
- Name: e.g., “Mythic Admin Logs”, “Connection Logs”
- Avatar: Optional custom icon
- Click “Copy Webhook URL”
Best Practice: Create separate channels for different log types (admin actions, connections, errors, etc.) to keep logs organized.
Available Webhook Types
Mythic Framework supports multiple webhook types for different logging purposes:1. Admin Logs Webhook
Purpose: Logs all admin actions and commands Variable:discord_admin_webhook
- Admin command usage (/kick, /ban, /tp, etc.)
- Permission grants/revocations
- Server configuration changes
- Resource restarts by admins
- Noclip, god mode, invisibility usage
2. Connection Logs Webhook
Purpose: Tracks player connections and disconnections Variable:discord_connection_webhook
- Player join attempts
- Successful connections
- Disconnections with reason
- Queue position updates
- Connection failures
3. Kill Logs Webhook
Purpose: Logs player deaths and kills for moderation Variable:discord_kill_webhook
- Player kills with weapon used
- Suicide/fall damage deaths
- Vehicle-related deaths
- Distance of kill
- Victim and killer information
4. Error Logs Webhook
Purpose: Critical error and crash reporting Variable:discord_error_webhook
- Server errors and crashes
- Resource errors
- Database connection failures
- Script runtime errors
- Performance warnings
5. Anti-Cheat Logs Webhook
Purpose: Security and anti-cheat detections Variable:discord_pwnzor_webhook
- Cheat/mod detections
- Suspicious activity (triggering non-existent events)
- Injection attempts
- Resource manipulation
- Automated bans
Recommended Channel Structure
Example Discord Server Structure
Example Discord Server Structure
- Admin logs: Staff only
- Connection logs: Staff + Moderators
- Kill logs: Staff + Moderators
- Error logs: Developers only
- Anti-cheat: Staff only
Complete Configuration Example
Webhook Message Customization
Some webhook features can be customized in resource configuration:Custom Embed Colors
Mythic Framework uses color-coded embeds:| Log Type | Color | Hex Code |
|---|---|---|
| Admin Actions | Purple | #8B5CF6 |
| Connections | Green | #10B981 |
| Disconnections | Yellow | #F59E0B |
| Kills | Red | #EF4444 |
| Errors | Dark Red | #DC2626 |
| Anti-Cheat | Orange | #F97316 |
Filtering Logs
You can configure which events get logged:Testing Webhooks
After configuration, test each webhook:Trigger Test Events
- Admin: Use an admin command
- Connection: Connect to server
- Kill: Kill or get killed by another player
- Error: Intentionally cause an error (restart a resource)
- Anti-Cheat: Trigger detection (if possible in dev)
Troubleshooting
Webhook Not Posting
Webhook Not Posting
Problem: Messages not appearing in DiscordSolutions:
-
Verify URL is correct
- URL should start with
https://discord.com/api/webhooks/ - Check for typos or truncation
- Ensure no extra spaces
- URL should start with
-
Check webhook still exists
- Webhooks can be deleted in Discord settings
- Recreate webhook if needed
-
Verify permissions
- Bot/webhook needs permission to post in channel
- Check channel permissions
-
Test webhook manually:
-
Check server console for errors
Rate Limited
Rate Limited
Problem:
429 Too Many Requests errorCause: Discord rate limits webhooks to:- 30 requests per minute per webhook
- 5 requests per second per webhook
- Reduce logging frequency
- Use multiple webhooks for high-traffic logs
- Implement batching in resource configuration
- Add delays between rapid events
Missing Information in Logs
Missing Information in Logs
Problem: Logs don’t contain expected dataSolutions:
- Check resource configuration for filtering settings
- Verify resource has access to required data
- Enable debug mode to see what’s being sent:
- Check console for webhook payload logs
Formatting Issues
Formatting Issues
Problem: Messages look broken or poorly formattedSolutions:
- Verify Discord doesn’t have embed display disabled
- Check user/server settings → Text & Images → Show embeds
- Ensure webhook payload is valid JSON
- Test with manual curl request
Webhook Deleted/Invalid
Webhook Deleted/Invalid
Problem:
404 Not Found or webhook disappearedCause: Webhooks can be deleted from Discord settingsSolutions:- Go to Discord channel → Edit Channel → Integrations → Webhooks
- Check if webhook still exists
- If deleted, create new webhook
- Update server.cfg with new URL
- Restart server
Security Best Practices
Keep URLs Private
- Never commit webhook URLs to public repositories
- Don’t share webhooks in public channels
- Use environment variables if possible
- Rotate webhooks if compromised
Restrict Channel Permissions
- Make log channels staff-only
- Use role permissions to control access
- Consider separate webhooks for different staff ranks
Monitor for Abuse
- Watch for unexpected messages
- Check webhook audit log in Discord
- Revoke and recreate if compromised
Advanced Configuration
Environment-Specific Webhooks
Conditional Webhook Loading
Custom Webhook Implementation
You can send custom webhook messages from your resources:Webhook Color Reference
Use these color codes for consistent Discord embed styling:Monitoring and Maintenance
Regular Checks
- Verify webhooks still work weekly
- Check for rate limit errors in console
- Monitor Discord channel for spam
- Review and update filters as needed
Webhook Rotation
- Rotate webhooks every 3-6 months
- Immediately rotate if compromised
- Update all server instances
- Document changes
Log Retention
- Discord doesn’t automatically delete messages
- Manually archive old logs periodically
- Use bots for automated cleanup
- Export important logs for records
Staff Training
- Train staff on reading logs
- Document log meanings
- Create response procedures
- Regular log review sessions