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/XCore/addons/XBans/config.yml and configure the Discord section:
    discord:
      enabled: true
      webhook-url: "https://discord.com/api/webhooks/1234567890/abcdefg..."
    
      notify-ban: true
      notify-mute: true
      notify-warn: true
      notify-kick: true
      notify-report: true
      notify-jail: true
  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.

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 toggling individual notify-* options. Common configurations:

  • Full logging — All options enabled. Best for moderation audit channels.
  • Bans only — Only notify-ban: true. For public-facing ban announcement channels.
  • Reports only — Only notify-report: true. For a staff-only report queue channel.

Consider creating separate Discord channels with separate webhooks for different purposes: one for public ban announcements and another for private staff-only logs with all events enabled.