Discord Integration
Overview
XBans can send real-time notifications to a Discord channel whenever a moderation action occurs. This keeps your staff team informed even when they're not in-game and provides a permanent log of all sanctions.
Webhook Setup
- Open your Discord server and go to the channel where you want moderation notifications.
- Click the gear icon (Edit Channel) next to the channel name.
- Go to Integrations > Webhooks.
- Click New Webhook. Give it a name (e.g., "XBans") and optionally set an avatar.
- Click Copy Webhook URL.
- Open
plugins/XBans/config.ymland configure the Discord section:discord: enabled: true webhook-url: "https://discord.com/api/webhooks/1234567890/abcdefg..." notify-on: - ban - ban-ip - mute - kick - report - warn - Run
/xbans reloadto apply.
Keep your webhook URL private. Anyone with the URL can send messages to your channel. If the URL is compromised, delete the webhook in Discord and create a new one.
Embeds are batched and sent through XCore, so a raid that produces a burst of bans delays the notifications instead of losing them: a channel that answers "too many requests" is left alone for as long as Discord asks, then the queue resumes. Notices still waiting when the server stops are sent as it shuts down, not dropped.
Message Types
XBans sends rich embed messages to Discord for each event type. Each embed includes relevant details formatted for easy reading:
| Event | Embed Info |
|---|---|
| Ban / Tempban | Player name, staff member, reason, duration (if temporary), server name |
| Unban | Player name, staff member who unbanned, original ban reason |
| Mute / Tempmute | Player name, staff member, reason, duration (if temporary), server name |
| Unmute | Player name, staff member who unmuted |
| Warn | Player name, staff member, reason, total warning count |
| Kick | Player name, staff member, reason |
| Report | Reporter name, reported player, reason |
| Jail / Unjail | Player name, staff member, duration (if temporary), reason |
Embeds are color-coded by severity: red for bans, orange for mutes, yellow for warnings, blue for reports, and green for removals (unban, unmute, unjail).
Customization
You can control exactly which events are sent to Discord by listing their types in notify-on: ban, ban-ip, ban-ip-range, mute, mute-ip, kick, warn, jail, the removals (unban, unban-ip, unmute, unmute-ip, unwarn, unwarn-all, unjail) and report. Common configurations:
- Full logging — Every type listed. Best for moderation audit channels.
- Bans only — Only
banandban-ip. For public-facing ban announcement channels. - Reports only — Only
report. For a staff-only report queue channel.
Separate channels for different purposes are what discord.routes is for: each group has its own webhook and its own list of types, one for public ban announcements and another for private staff-only logs, say. A type listed in a route is always sent there, whatever notify-on contains, and a group with no url, here or in secrets.yml, is off.