Using Webhooks and Autorole Bots to Make a Mystery Game in Discord

In 2022, I got the wild idea to create a Discord mystery game to learn more about Discord bots. Join the Discord here.

Satellite Beach News is a text adventure game where players explore a fictional town's Discord server to unravel the mystery of a missing woman. Players read messages from various characters to uncover a story about a newcomer to town and a woman who has mysteriously disappeared. Alongside in-game messages, players find clues outside of Discord, like in a YouTube video and a voicemail recording, that help them unlock new channels and progress the story.

The narrative and tone are inspired by the Welcome to Night Vale podcast.

How it works:

Players read through messages sent by different bots, each with a unique name and avatar, giving them the feel of distinct characters. I used webhooks to send these messages into Discord, creating immersive character dialogue.

Webhooks in Discord are a low-effort way to post messages to channels in Discord. They don’t require a bot user or authentication to use, and it takes very little time to put it together. Just a simple script and a webserver are all that’s needed.

Using a webhook is simple. You just need to make an HTTP POST request to a URL provided by Discord, with the message you want to send in the body of the request. Discord will then post that message to the specified channel.

Here’s one of my scripts, which just includes a simple ‘send’ button to post the message to the server:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SBN Pay Phone</title>
  </head>
  <body>
    <button onclick="sendMessage()">Send</button>
  </body>

  <script>
    function sendMessage() {
      const request = new XMLHttpRequest();
      request.open("POST", "https://discord.com/api/webhooks/1005937463069516007/nb8dD9ieSLImdiq1RxftYIhUk0o-BzkxeHSmEDakTpwXQVtb-1I4n8ot3IqasVp7BBXg");

      request.setRequestHeader('Content-type', 'application/json');

      const params = {
        username: "",
        avatar_url: "",
        content: "Are the psychic woman and Old Man Taylor involved? There are some rumors spreading."
      }

      request.send(JSON.stringify(params));
    }
  </script>
</html>

I’m writing this two years after I made the game, so just make sure to check the Discord documentation for writing webhooks correctly because it may have been updated since then.

When players find a password, either in the dialogue, in a channel, or elsewhere, they can type it into a specific channel to unlock new channels and information. By inputting a password, players are assigned a new role with access to specific channels.

Some of these roles are assigned by these passwords, but some are also based on time spent in the server. I wanted to show the main mechanic of the game, unlocking new channels, early on so players could see how to progress within the first minute they’re in the server. When you enter the server, you’ll only see a few channels. But as you can see from the screenshot below, there are quite a few channels to unlock, which are hinted to in the channel descriptions.

I used Dyno.gg’s custom commands to enable the unlocking of channels based on a password, and Dyno.gg’s autoroles to add roles to players after a period of time. Dyno.gg is a fully customizable server moderation Discord bot for your Discord server that features a simple and intuitive web dashboard. I had tried a few different automation bots before landing on one, but this one was free for the features I wanted and easy to use.

As for where the passcodes were found by the players, some of them were in plain sight in the channels, some were alluded to, one was in a Youtube comment, and one was on a voicemail.

I’ve always been a VOIP phone user with multiple phone numbers using Talkatone or Google Voice. I ended up using Talkatone to generate a phone number with the area code I needed, and recorded a voicemail that mentioned the passcode to the final area. Players did not enjoy calling random phone numbers! I had generated fake numbers, but one player mentioned someone actually picked up the call (WHOOPS). Anyways, I no longer host the phone number and the password is listed as a spoiler in Discord for people who want to finish the game and figure out the end of the story.

I learned a lot about managing a Discord by making this, and got to work on a story that delivered an alternate reality game-like experience. A lot more people played it than I had hoped! Over 100 people joined the server over the course of time, and many people made it to the end.

Next
Next

Video Game Design for Dummies is Available for Pre-Order!