Setting Up a Discord Webhook to Automatically Post Free Games

This took me a bit of time to figure out, but I’ve managed to find a way to monitor Reddit’s /r/GameDeals subreddit and automatically post the free games from there to a Discord server. This idea was based on the IFTTT Applet “Mail me free games with Steam keys posted to /r/gamedeals”. Everything included below has been tested personally and works as of the time of this post. If things should change, I will endeavor to keep the information current, but no promises. It is also worth noting that this webhook will pull games that are temporarily free (I.E, games that are offering a free weekend playthrough). There’s no way to accurately pull completely free games only [20190713 EDIT: Adding “100%” to the filter list should ensure you only get notified for truly free games]. With that being said, let’s get started.

Part 1 – Creating the webhook

A webhook is basically a lengthy URL that certain applications can use to send and retrieve information without the need for credentials. Obviously, this means that anyone with the webhook can wreak some havok on your server, so be absolutely certain to keep it private! To create the webhook:

  1. Open Discord on your PC. **You can not create a webhook using the mobile site or mobile app.**
  2. Go to your server’s settings.
  3. Click on “Webhooks” in the left-hand menu.
  4. Click on “Create Webhook”.
  5. Enter a name for the bot that will post your free games.
  6. Choose the channel in which the free games will be posted.
  7. Upload an avatar to represent your bot (optional).
  8. Copy the Webhook URL. **DO NOT SHARE THIS WITH ANYONE**
  9. Click “Save”. You have now created your webhook.

Part 2 – Creating the bridge

Now that you’ve created the webhook, you need a way to pull the information from the subreddit and post it to the Discord via that webhook. Thankfully, there’s a website that’s built just for such a job: IFTTT, which stands for ‘If This, Then That’ (a common programming structure). This website allows users to create applets that follow that mentality; IF this (X) condition is met, THEN that (Y) action will happen. You’ll be using this site to create an applet that links Reddit and Discord. To do so:

  1. Create an IFTTT account.
  2. Click the “New Applet” button under your avatar. This should take you to the IFTTT Platform site (
  3. If this is your first time creating an applet, it’ll ask you to enter information regarding yourself and your company. Simply fill out the information in any way you wish; your applet will be private.
  4. Once you’ve finished with your Platform profile, click on the “Applets” menu option.
  5. Click on the “New Applet” button.
  6. Under the Trigger section, you need to select where you’re pulling the information from. In this case, we’ll be using Reddit, so select “Reddit” as the trigger service.
  7. By selecting Reddit, the options below the trigger should have changed. You now need to select what you want the trigger to do on Reddit. Select “New post from search”.
  8. You should see that there’s a field available below that, and the Field Label should be set to “search for”. Keep the visibility as “Hidden from user”, and in the Value block, enter the following:
  9. Your trigger is now set up. You now need to set up the Action, which is where the pulled information is reformatted and posted to the Discord server.
  10. For the Action, you’ll need to select “Webhooks” as the service.
  11. This *should* have already selected the correct option, but if it didn’t, select “Make a web request” below the Webhooks service.
  12. For the Action, keep all Visibility options set to “Hidden from user”.
  13. Under the “URL” Field Label, in the Value block, paste your webhook url (the one you created in Part 1 of this guide).
  14. Under the “Method” Field Label, in the Value block, select “POST”.
  15. Under the “Content Type” Field Label, in the Value block, select “application/json”.
  16. Under the “Body” Field Label, in the Value block, copy/paste the following code:
    {"embeds": [{ "title" : "<<<{{Title}}>>>", "url" : "{{PostURL}}", "image":{ "url": "{{ImageURL}}" } }]}
  17. Name your Applet.
  18. Give a description for your Applet.
  19. Save the Applet. You’ve now successfully bridged the subreddit and your Discord server.

Part 3 – Hitting the switch

So, you’ve created the webhook and the applet that bridges the subreddit and Discord server. The only thing left to do now is turn it on and wait for a new free game to be posted. To turn the applet on:

  1. In the IFTTT Platform, click on the Applets menu option.
  2. View your Private Applets.
  3. Click on the applet you just created.
  4. You should now see a link that says “View on IFTTT”. Click it; this will take you back to the main IFTTT site.
  5. From here, you should see your applet, with a large On/Off toggle switch in the center. Simply toggle it to the “On” position.

That’s all there is to it! You’ve now successfully enabled free games to be posted to your Discord server. It is important to note that you won’t notice it’s effects immediately, as the bridge you created will only pull new entries as their posted; it will not search for old entries of free games. It may be a day or so before you see a free game posted, but if you followed the steps in this guide to the letter, it should work flawlessly. Enjoy!