Skip to content

Discord webhooks

The AC notifies Discord through routes: each type of notice (bans, detections, staff…) can go to its own channel. You do not have to set them all up. A single default webhook is enough and the AC uses it for everything.

Copy ac_core/secrets.example.json to ac_core/data/secrets.json and fill it in. The file stays on the server only and the panel never receives it: it only sees “Set” or “Empty”.

{
"webhooks": {
"default": "https://discord.com/api/webhooks/ID/TOKEN",
"bans": "https://discord.com/api/webhooks/ID/TOKEN",
"detections": "https://discord.com/api/webhooks/ID/TOKEN",
"staff": "https://discord.com/api/webhooks/ID/TOKEN"
},
"vpnApiKey": ""
}
Field What it is for
webhooks.default The fallback channel for everything without its own webhook.
webhooks.<route> The webhook of one route (table below). Set only the ones you want separated.
webhooks.admin The “legacy” fallback channel of the administration routes (see below).
vpnApiKey The proxycheck.io key, for the VPN block (join.vpn.enabled).
licenseKey Optional. If you put the activation key here, the AC activates with it and removes it from the file afterwards.

Every notice belongs to a route. If the route has no webhook of its own, the AC looks for the fallback channel listed and, last of all, default.

Route What it sends Webhook used, in order
bans Bans, unbans, the ban wave queue and its runs bans, default
detections Detections (score, kick and ban alerts) detections, default
economy Economy detections (economy.*) economy, detections, default
screenshots Screenshots taken when someone presses a mod menu key screenshots, detections, default
licenses Notices about the connection to the VIGIL AC service licenses, admin, default
diagnostics Errors and warnings from the AC itself diagnostics, admin, default
staff Reports, staff actions in the panel, staff chat (if copied), the daily digest, observation mode staff, admin, default
infrastructure Startup, updates, security alerts, protected resource stopped infrastructure, admin, default

If there is no webhook at all (not even default), notices do not go to Discord, but they stay in the log file and in the panel. Security health warns “No Discord webhook” when default is missing.

Turning each route on, off and limiting it

Section titled “Turning each route on, off and limiting it”

In data/config.json:

{
"webhooks": {
"routes": {
"detections": { "perMinute": 15 },
"economy": { "enabled": false }
}
}
}
Option Default What it does
webhooks.routes.<route>.enabled true With false, that route sends nothing.
webhooks.routes.<route>.perMinute bans 30, detections 30, economy 20, screenshots 10, licenses 10, diagnostics 10, staff 30, infrastructure 20 Maximum messages per minute. The excess is dropped and counted, so an attack cannot exhaust Discord’s rate limit.
logging.discord true Master switch: with false, nothing goes to Discord.
logging.discordDedupeSeconds 60 The same detection for the same player is only sent again after this time (kicks and bans are always sent).

If Discord answers 429 (rate limit), the AC waits and retries (up to three times, with growing waits).

In webhooks.templates you define the look. default applies to every route and each route can override fields.

{
"webhooks": {
"templates": {
"default": { "titlePrefix": "[Server A] ", "footer": "{server} | AC {version} | {date}" },
"bans": { "color": "ban", "hideIp": true, "hideSerial": true, "attachImage": false }
}
}
}
Field What it does
titlePrefix Text before the title (up to 40 characters).
footer Footer (up to 200 characters). Accepts {server}, {version} and {date}.
color A name (log, warn, kick, ban, info, update) or a number.
hideIp, hideSerial Remove the IP and serial from the fields and from any text. Useful in public channels.
attachImage With false, the screenshot is not attached.

Values of the wrong type are ignored. The name shown in Discord is “VIGIL AC”, or “server tag · VIGIL AC” if you change general.serverTag.

  1. Save secrets.json (and config.json, if you edited it).
  2. In the server console: /ac reload.
  3. In Configuration > General, in the Secrets card, each route shows Set, Inherited (it uses the fallback channel), Empty, Off or Failed with the HTTP code. Hover to see how many messages were sent and dropped by the limit.

If nothing reaches Discord, see Empty webhooks or no messages.