Authors Note:

Originally written for the members of the Hi-Rez Community Europe, this guide has been updated and tweaked with newer methods and additions. Good luck and have fun!


Update:

I have found some issues with method 2 so for the moment I don’t recommend using it, I’m trying to find a solution so you don’t end up with an unreadable mess like this:

WRONG

Will update you when I find out what to do! 🙂


My discord server decided that we would like to know if something has happened to the Hi-Rez servers, so we have been using discord’s webhooks to push a message to a channel on our server when something happened (using webhooks because we couldn’t afford the resources to keep a server running 24/7 just for this). Here’s how to do it:

There are two methods of doing this and they are both slightly different but produce similar results:

1. Receiving the updates via Twitter (refreshes more frequently but you will be limited to the 140 characters the twitter bot gives out) Example:

16

2. Receiving the updates via an RSS feed (provides a richer experience however the feed will refresh every few minutes) Example:

11
You may notice that this looks slightly different to the one posted in the Hi-Rez EU server, that is because I found issues with hiding the link behind the markdown and some setups throwing up errors such as “This link could be potentially dangerous”


Method 1

Step 1

Sign up for an IFTTT account, we will be using this service since running a server 24/7 for this purpose is a little bit extreme

Step 2

Create a new applet. You will want to choose Twitter and Webhook for your IF and THAT (click images to expand):

The username you need is: @HirezOps

Step 3

Setting up the webhook now, we’ll have to generate a URL first so hop into discord, go to the settings of a text channel and select “Webhooks” and you should be presented with a screen like this:

6

You will want to click “Create Webhook” and fill out the information presented on screen. I would suggest here that you give the bot a name and a profile picture:

7

Copy the Webhook URL as seen at the bottom and click “Save”

Head back to your IFTTT and paste the Webhook URL into the URL feed into the URL field of the webhook:

8

Step 4

Scrolling down a bit, we will need to set the Method to “Post” and the content type to “application/json” like so:

9

Step 5

Now we are going to fill out the body. This will help to format the data into a more readable format.

{"content":"**@{{UserName}}** posted: {{Text}}"}

Note: You can use “add ingredient” which is located underneath the body box to see what parameters are available

This will produce something like the following:

PW
As seen on the Paladins World discord server

Or, if you’d prefer a slightly nicer looking version as seen here:

TCTC
From my own personal server, name shortened to TCTC for various reasons

You can use the following:

{ "embeds": [ { "color": "7052242", "title" : "{{CreatedAt}}", "url" : "{{LinkToTweet}}", "author" : { "name" : "@{{UserName}}", "url" : "https://twitter.com/{{UserName}}" }, "description" : "{{Text}}" } ] }

Please be aware though, this may not work with everybody because there is an option to disable embed previews in discord itself.

Discord

You can read more about how to customise this below

Step 6

Now that you have set it all up you just have to wait for an issue to arise. Feel free to tweak around with the body text using discords own guidelines found here


Method 2

Step 1

Sign up for an IFTTT account, we will be using this service since running a server 24/7 for this purpose is a little bit extreme

Step 2

Create a new applet. You will want to choose RSS and Webhook for your IF and THAT (click images to expand):

The URL for the feed is: http://status.hirezstudios.com/history.atom

Step 3

Setting up the webhook now, we’ll have to generate a URL first so hop into discord, go to the settings of a text channel and select “Webhooks” and you should be presented with a screen like this:

6

You will want to click “Create Webhook” and fill out the information presented on screen. I would suggest here that you give the bot a name and a profile picture:

7

Copy the Webhook URL as seen at the bottom and click “Save”

Head back to your IFTTT and paste the Webhook URL into the URL feed into the URL field of the webhook:

8

Step 4

Scrolling down a bit, we will need to set the Method to “Post” and the content type to “application/json” like so:

9

Step 5

Now we are going to fill out the body. This will help to format the data into a more readable format. We are going to set the webhook up to publish as plaintext, the body for this looks like so:

{ "content":"** {{EntryTitle}}** Posted: {{EntryPublished}} {{EntryContent}} **URL**: {{EntryUrl}}" }

Note: You can use “add ingredient” which is located underneath the body box to see what parameters are available

This will produce something like the following:

11

Step 6

Now that you have set it all up you just have to wait for an issue to arise. Feel free to tweak around with the body text using discords own guidelines found here


What next?

Now that it’s all set up you will want to keep an eye on the applets in case of failures, you should get an email if a failure does occur.

Keep playing around with the format of the body to suite your needs.

15

One thing you may like to try is to use embeds, I am currently playing around with those right now however haven’t had a chance to test them properly yet (because the Hi-Rez status page has been quiet recently). They allow for slightly nicer data layouts including adding a colour to the accent on the embeds (pictured on the left). Although it does appear to be requiring an integer for the colour, this can be worked out here. The Hi-Rez colours as integers are:

Black: 1037, Purple: 1842767, Light Purple: 7052242 and Grey: 10067364

For the Tweet method:

{ "embeds": [ { "color": "7052242", "title" : "{{CreatedAt}}", "url" : "{{LinkToTweet}}", "author" : { "name" : "@{{UserName}}", "url" : "https://twitter.com/{{UserName}}" }, "description" : "{{Text}}" } ] }

For the RSS method:

{"embeds": [ { "title" : " {{EntryPublished}}", "url" : " {{EntryUrl}}", "author" : { "name" : " {{EntryTitle}}", "url" : " {{EntryUrl}}" }, "description" : " {{EntryContent}}", "color":"1842767" } ] }

These aren’t guaranteed to work for everyone since there is an option in discord to disable viewing of embeds on the users end however I shall update this guide if I can get them working 100%


If you have any thoughts or comments, please leave them below or there’s a reddit thread which can be found here

Let me know what you thought, how I did and what could be improved. Any and all feedback will be greatly appreciated.

Thanks all for reading, and I’ll see you in the future!

Advertisements

2 thoughts on “Hi-Rez Status and Webhooks

  1. Originally written for the members of the Hi-Rez Community Europe, this guide has been updated and tweaked with newer methods and additions. Good luck and have fun!

    Like

Let me know what you think!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s