Discord webhooks

From Beasts of Bermuda
Jump to: navigation, search

Using Discord webhooks

Beasts of Bermuda, as of recently, supports Discord webhooks to better moderate your dedicated servers. For its setup, you will need
  • To implement Discord webhooks on your Discord Server.
  • To set up your Beasts of Bermuda Server to communicate with your Discord server through a config setup.

With the Discord Webhooks, you can track your server(s) activity live and monitor chat, combat, group activity, logins/logouts, and admin command usage. These feeds can be put in separate private moderation channels, or all in the same spot and/or using the same Discord Webhook (not recommended).

Setting webhooks up

First of all, you will need to Create discord webhooks on your Discord server. Once that is done, open the Game.ini file, located under your {installFolder}/BeastsOfBermuda/Saved/Config/WindowsServer. If it does not exist, create it under this location.

Set the config up
-Copy-Paste the following text if it is not already there

[GameReporter]
ChatReportDiscordWebhook="123456/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"
ChatReportIconURL=""
LoginDiscordWebhook="123456/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"
LoginDiscordIconURL=""
AdminCmdDiscordWebhook="123456/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"
AdminCmdDiscordIcon=""
GroupActivityDiscordWebhook="123456/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"
GroupActivityDiscordIconURL=""
CombatActivityDiscordWebhook="123456/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"
CombatActivityDiscordIconURL=""

bUseChatWebhook=False
ChatWebhookFormatStyle="[:x01]<{PlayerInfo}>[:x01] <ChatMode={ChatMode}> **>** _{msg}_"

bUseLoginReportWebhook=False
LoginReportFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] joined server _{Server}_\n----"
LogoutReportFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] left server _{Server}_, played for {Hours} hours and {Minutes} minutes.\n----"

bUseAdminCommandUsageWebhook=False
AdminCommandUsageFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] used command [:x01]{Cmd}[:x01]\n----"

bUseGroupActivityWebhook=False
bUseCombatActivityWebhook=False


Now, do not run away so soon! We will go through the settings together. The first thing you need to know, is that the webhook link setting automatically parses the link to the discord API. This means you only want to use part of the link provided by discord webhooks. Example:

https://discordapp.com/api/webhooks/864574086981222411/E4W2PurzqHUS6OnLVNWjNQIdEcoia4Q6nMYL46d6g3FxYR6BvyLMt3sWP0WphoZpsuoa
Becomes
864574086981222411/E4W2PurzqHUS6OnLVNWjNQIdEcoia4Q6nMYL46d6g3FxYR6BvyLMt3sWP0WphoZpsuoa

In order to enable a webhook, you want to set the matching config setting to True according to the following example:
Note that we will be using the chat webhook as an example but the exact same logic applies to every other GameReporter setting.

Create the chat webhook on your discord server according to the discord documentation. Fill up the config setting named

ChatReportDiscordWebhook

with the link you have just copy-pasted. Then, remove everything before the first numbers so your setting looks like the following:

ChatReportDiscordWebhook="12345679101112/examplekey_dwdhwaowdawbdwaowdcic11938374-ce"

and set the matching setting to True as follows:

bUseChatWebhook=True

With that set up, you will have an active Chat webhook. If you want, you can also have a custom "Profile Picture" URL for the webhook you have setup by using any URL to an image supported by Discord. You can do this by setting the Icon setting matching your webhook. For the chat example, this would do as follows:

ChatReportIconURL="https://j.gifs.com/vQ8EzL.gif"



Setting up a custom format for Webhooks

Most of the webhooks support a custom format that you can set up how you wish. The example provided here represents every parameter supported per custom formats. Every format supports Markdown according to discord's documentation, HOWEVER, for parsing purposes, the following are handled by special syntax:

  • [:x01] is a a Backtick ( ` ), these are used by discord for "code blocks".
  • \n is a Backspace.

The default formats are as follows per webhook:

ChatWebhookFormatStyle="[:x01]<{PlayerInfo}>[:x01] <ChatMode={ChatMode}> **>** _{msg}_"
LoginReportFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] joined server _{Server}_\n----"
LogoutReportFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] left server _{Server}_, played for {Hours} hours and {Minutes}
AdminCommandUsageFormatStyle="Player [:x01]<{PlayerInfo}>[:x01] used command [:x01]{Cmd}[:x01]\n----"

Again, note the provided {parameter} are only applicable on the format styles they are used on. This means that, for example, the {Server} parameter only works on the login/logout webhook, or that the {Cmd} parameter is only available on the admin command usage webhook.

  • {PlayerInfo} is the Player name and Steam ID of the player the webhook is reporting. The steam ID will be built using the game owner account and the alt account ID if the player is using alt accounts, otherwise it will only show the owning account if they are not using an alt in the following style: OwnerAccount : PlayingAccount (eg 7653888282822842 : 76538388282822810).
  • {ChatMode} is the chat mode being used. this will be either A for All, G for Group, L for Local or DM for private messages.
  • {msg} will be the message sent by the player.
  • {Server} is the server name the player has logged in or out of. This will be the server name you are using in your command line
  • {Hours} is how many hours the player has played before logging out
  • {Minutes} is how many minutes the player has played before logging out.
  • {Cmd} is the command the player has used.

the output for such setup, using the Chat webhook as example, will look like this on Discord:

Text parse wb.png







Config settings details

  • ChatReportDiscordWebhook is the webhook that will be used for chat activity.
  • ChatReportIconURL is the URL to an icon to use for the chat discord webhook (optional)
  • LoginDiscordWebhook is the webhook used to track login/logout activity on your server
  • LoginDiscordIconURL is the URL to an icon to use for the login discord webhook (optional)
  • AdminCmdDiscordWebhook is the webhook used to track command usage activity on your server
  • AdminCmdDiscordIcon is the URL to an icon to use for the command usage tracking webhook (optional)
  • GroupActivityDiscordWebhook is the webhook used to track group activity (group creation, adding, removing of players...)
  • GroupActivityDiscordIconURL is the URL to an icon to use for the group activity tracking on your server (optional)
  • CombatActivityDiscordWebhook is the webhook to use to report combat activity. This will output a full combat log leading to every player's death in blocks of text.
  • CombatActivityDiscordIconURL is the URL to an icon to use for the combat activity on your server (optional)
  • bUseChatWebhook True/False enables or disables the chat webhook. False by default.
  • bUseLoginReportWebhook True/False enables or disables the login webhook. False by default.
  • bUseAdminCommandUsageWebhook True/False enables or disables the command usage webhook. False by default.
  • bUseGroupActivityWebhook True/False enables or disables the group activity webhook. False by default.
  • bUseCombatActivityWebhook True/False enables or disables the combat activity webhook. False by default.
  • ChatWebhookFormatStyle is a text format to use for the chat webhook.
  • LoginReportFormatStyle is a text format to use for the login/logout webhook when logging in.
  • LogoutReportFormatStyle is a text format to use for the login/logout webhook when logging out.
  • AdminCommandUsageFormatStyle is a text format to use for the command usage webhook.



Output examples

Combat webhook output example

Combat output example for the Combat webhook.














Group activity webhook output example

Group output example for the group webhook











Command activity webhook output example

Command activity output example for the command usage webhook







There, now you know how to set up Discord webhooks for your Beasts Of Bermuda Server!