Skip to the content
Docs

Discord Webhooks

On this page4

The panel can copy its log lines into Discord channels. This is optional: every line is on the Logs page of the panel anyway. The six webhooks are in config_server.lua.

The six webhooks

lua
ConfigServer.Webhooks = {
    bans     = '[YOUR WEBHOOK URL]',
    warns    = '[YOUR WEBHOOK URL]',
    kicks    = '[YOUR WEBHOOK URL]',
    actions  = '[YOUR WEBHOOK URL]',
    reports  = '[YOUR WEBHOOK URL]',
    connects = '[YOUR WEBHOOK URL]',
}
KeyDefaultAllowedWhich log lines land there
bans''A Discord webhook URL · ''Bans, revoked bans, and a banned PC that was refused at joining.
warns''A Discord webhook URL · ''Warnings and revoked warnings.
kicks''A Discord webhook URL · ''A kick of one player.
actions''A Discord webhook URL · ''Every other staff action. See the list below.
reports''A Discord webhook URL · ''Tickets and sits. See the list below.
connects''A Discord webhook URL · ''Every player who joins or leaves the server.
KeyIn detail
actionsActions on a player: go to, bring, spectate, freeze, revive, heal, kill, private message, screenshot, inventory, money, items, job, model, reset look, bucket, jail and release. Self tools. World actions, also Kick all. Ranks and staff. Notes and alerts. FairShield lookups.
reportsA new ticket, claim, give back, take over, a reply from staff, resolve, and a ticket that went back to waiting because its staff member left. In a sit: add or remove a player, heads-up, bring, go there, send back, end.

When a key is empty

Empty keyWhere its lines go
bans, warns, kicks or reportsTo the actions webhook. When actions is empty too, they are not sent to Discord.
actionsNot sent to Discord.
connectsNot sent to Discord. Joins and leaves never go to the actions channel: they would fill it.
  • One channel for everything: fill in only actions. Bans, warnings, kicks and tickets land there too.
  • Joins and leaves need their own URL in connects.

Set it up

  1. In Discord, open the settings of the channel: Integrations → Webhooks → New Webhook. Copy the webhook URL.
  2. Open config_server.lua and paste the URL between the quotes of the key.
  3. Restart the resource.
  4. Test it with one action of that kind, for example warn a test character for warns. A message appears in the channel.

What a message looks like

PartContent
Sender5Code Admin
Title5Code Admin — and the action, for example ban, kick or report:claim
StaffThe name of the staff member. For joins, leaves and a refused banned PC the field is named Player.
TargetThe identifier (game license) of the player the action was about, when there is one
More fieldsDetails of the action, for example the reason and the duration of a ban
Bottom lineDate and time
  • A screenshot of a player's screen is never sent to Discord.
  • config_server.lua is loaded on the server only. It is never sent to a player's game.

Related: Logs · FairShield · Updating.