Skip to content
Discord Integration

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

  1. Open your Discord server and go to the channel where you want moderation notifications.
  2. Click the gear icon (Edit Channel) next to the channel name.
  3. Go to Integrations > Webhooks.
  4. Click New Webhook. Give it a name (e.g., "XBans") and optionally set an avatar.
  5. Click Copy Webhook URL.
  6. Open plugins/XBans/config.yml and 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
  7. Run /xbans reload to 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:

EventEmbed Info
Ban / TempbanPlayer name, staff member, reason, duration (if temporary), server name
UnbanPlayer name, staff member who unbanned, original ban reason
Mute / TempmutePlayer name, staff member, reason, duration (if temporary), server name
UnmutePlayer name, staff member who unmuted
WarnPlayer name, staff member, reason, total warning count
KickPlayer name, staff member, reason
ReportReporter name, reported player, reason
Jail / UnjailPlayer 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 ban and ban-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.