Webhook Setup

Guardex supports Discord webhooks for real-time notifications. This allows you to receive alerts about player connections, bans, detections, and more directly in your Discord server.

Creating a Discord Webhook

  1. Go to Server Settings

    Open your Discord server and click on the server name to open the dropdown menu. Select "Server Settings".

  2. Navigate to Integrations

    In the server settings sidebar, click on "Integrations".

  3. Create a Webhook

    Click on "Webhooks" and then "New Webhook".

  4. Configure the Webhook

    Give your webhook a name (e.g., "Guardex Bans"), optionally set an avatar, and select the channel where you want the notifications to be sent.

  5. Copy the Webhook URL

    Click "Copy Webhook URL". This is the URL you'll need to add to your Guardex configuration.

Discord Webhook Creation

Discord Webhook Creation Interface

Configuring Webhooks in Guardex

Once you have created your Discord webhooks, you need to add them to your Guardex configuration:

  1. Open your config.lua file

  2. Locate the Webhooks section

  3. Add your webhook URLs

    Config.Webhooks = {
        Enabled = true, -- Set to true to enable webhooks
        PlayerConnect = {
            Enabled = true,
            URL = "YOUR_DISCORD_WEBHOOK_URL_HERE"
        },
        Bans = {
            Enabled = true,
            URL = "YOUR_DISCORD_WEBHOOK_URL_HERE"
        },
        Detections = {
            Enabled = true,
            URL = "YOUR_DISCORD_WEBHOOK_URL_HERE"
        },
        TriggerMonitor = {
            Enabled = true,
            URL = "YOUR_DISCORD_WEBHOOK_URL_HERE"
        }
    }
  4. Save the file and restart your server

Testing Your Webhooks

After configuring your webhooks, you can test them to ensure they're working correctly:

  1. In-game, use the test command:

    /gxtestwebhook all
  2. Check your Discord channel

    You should see test messages for each webhook type.

Webhook Types

TypeDescription
PlayerConnectNotifies when players connect to or disconnect from the server
BansNotifies when players are banned or unbanned
DetectionsNotifies when cheats or suspicious activity are detected
TriggerMonitorNotifies when monitored events are triggered

Webhook Rate Limits

Discord imposes rate limits on webhooks (max 30 requests per minute). If you have a high-traffic server, consider using separate webhooks for each notification type to avoid hitting these limits.