Webhooks - Alderon-Games/pot-community-servers GitHub Wiki

[!CAUTION] We have moved our documentation to a new location! Please visit Webhooks Setup for the most up-to-date information for this page.

Webhooks allow external services to be notified when certain events happen. When the specified events happen, we’ll send a POST request to each of the URLs you provide.

Important Note: The server must be stopped while editing server files. You must save your edits and restart your server for any edits to take effect.

To setup Webhooks, you must edit the Game.ini file.

Path: Config/WindowsServer/Game.ini

Underneath the [ServerWebhooks] header, create an entry PlayerReport="https://discord-webhook-url-here/"

Path: /Config/WindowsServer/Game.ini

Example Game.ini

[ServerWebhooks]
; Set this to true if you want the server to call webhooks
bEnabled=true
; Discord or General
; Discord will format the messsage for posting directly to the channel
; General will format the message to be consumed by your own website / server / backend
Format="Discord"
PlayerReport="https://discord-webhook-url-here/"
PlayerLogin=""
PlayerLogout=""
PlayerLeave=""
PlayerKilled=""
PlayerQuestComplete=""
PlayerQuestFailed=""
PlayerRespawn=""
PlayerWaystone=""
ServerRestart=""
AdminSpectate=""
AdminCommand=""

Creating Discord Webhooks

You can create a Discord webhook for your Discord channel by following these steps:

  1. Go into your desired channel settings and select "Integrations"
  2. Create a new webhook.
  3. Copy the webhook URL and paste it into your Game.ini file.

Webhook List

PlayerReport

Called when a player reports someone else in-game.

{
  "ReporterPlayerName": "Test1",
  "ReporterAlderonId": "048-236-424",
  "ServerName": "Server",
  "Secure": true,
  "ReportedPlayerName": "Test2",
  "ReportedAlderonId": "123-430-121",
  "ReportedPlatform": "Desktop",
  "ReportType": "Killed By User",
  "ReportReason": "KOS (Killed on Sight)",
  "RecentDamageCauserIDs": "123-430-121, 135-654-234,"
  "NearbyPlayerIDs": "123-430-121, 135-654-234,"
  "Title": "I got killed",
  "Message": "please help!",
  "Location": "(X=328866.125,Y=-130023.359375,Z=853.25)",
  "Version": "0.0.0.12968",
  "Platform": "Desktop"
}

PlayerLogin

Called when a player logs in.

{
  "ServerName": "Server",
  "PlayerName": "Test1",
  "AlderonId": "048-236-424",
  "BattlEyeGUID": "05db16f3014acfdd6cc48dc7ce99168e",
  "bServerAdmin": false
}

PlayerLogout

Called when a player logs out.

{
  "ServerName": "Server",
  "PlayerName": "Test1",
  "AlderonId": "048-236-424",
  "BattlEyeGUID": "05db16f3014acfdd6cc48dc7ce99168e"
}

PlayerLeave

Called when a player logs out to the character selection screen

PlayerKilled

Called when a player is killed

PlayerQuestComplete

Called when a player completes a quest

PlayerQuestFailed

Called when a player fails a quest

PlayerRespawn

Called when a player respawns.

PlayerWaystone

Called when a player uses a waystone to teleport someone

ServerRestart

Called with server restart warning notices to relay these in discord.

AdminSpectate

Called when an admin activates the spectator mode.

AdminCommand

Called when an admin runs a server command using chat.

PlayerHack (After revision 21724)

Called when a player is detected of speed hacking.