ServerDiscordBotIntegration - festivaldev/Paradise GitHub Wiki

Discord Bot Integration

Paradise allows server operators to connect their Discord server members and UberStrike players through the use of a Discord bot.
The bot features Chat integration a selected Discord channel and UberStrike's lobby chat, executing commands, announcing players and games, as well as sending runtime errors into a specific channel.

General Setup

First of all, you'll need a Discord bot and its access token. If you already have a valid access token, you can continue below. If not, follow these instructions to add a bot to your server. Don't worry, you don't need to write any code.

Once you have your access token, make sure the Discord plugin (<path to Paradise.WebServices>\Plugins\Discord.plugin) is installed and not blacklisted in Paradise.Settings.WebServices.xml, so that it can actually be loaded when starting the Web Services.

Bot Setup

  • Open Paradise.Settings.Discord.xml. If it's not in your server directory, grab a fresh copy from the latest server release.
  • Set EnableDiscordIntegration to true. If you want to disable the bot again, just set it to false.
  • Paste your access token where it says <!-- Insert Discord Application Token here -->. Make sure to replace the whole text, but keep the <Token> tags. If this is not done correctly, the bot will fail to start.

For the next part, you'll need to have Developer Mode in Discord enabled. Enabling it allows you to copy Discords internal IDs for servers (aka. "Guilds") and channels.
To enable it, open the User Settings and navigate to Advanced. Flip the Developer Mode switch to enable it.

Next, copy your Server ID by right clicking on your server icon → Copy Server ID. Paste that ID under GuildId in the XML.
To enable a feature, it needs a valid Discord Channel ID, which can be copied by right-clicking any of your server's channels and pasted into the desired [...]ChannelId in the XML. You can use one channel for everything, but it is recommended to use a separate channel for each feature.

List of Features

Key Type Default Description
ChatIntegration bool true Allows Discord server members to chat with players in UberStrike's Lobby chat and vice-versa.
CommandIntegration bool true Allows authorized users to execute commands.
PlayerAnnouncements bool false Announces players joining or leaving UberStrike.
GameAnnouncements bool false Announces game room creation, showing game details and allowing Discord users to join the game.
ErrorLog bool false Posts runtime errors into a specific channel, which can then be used to open a GitHub issue.

Lobby Chat

If you would like to enable lobby chat integration, you'll need a Webhook. To create one, open your Discord server settings and navigate to IntegrationsWebhooks. Click on New WebHhook, which will create a new Webhook called "Spidey Bot".
Click on the newly created Webhook to select a channel to post into, which should be a channel where people on your sever can chat with UberStrike players. Also make sure to give this Webhook a descriptive name.
Finally, click on Copy Webhook URL and paste that into WebHookUrl (replacing the default <!-- Insert Discord Webhook URL here -->) and set ChatIntegration to true to enable it. To disable it again, just set it to false.

Linking Users

To use some of the features, such as Lobby chat or executing commands, users will need to link their Discord profile with their UberStrike account.
To do so, open the UberStrike Lobby chat and send a message just containing ?link. The server will then respond with a code visible only to you that you need to send to the Discord bot as a DM. Once that is done, you can use the Lobby chat from within Discord or, if you have proper permissions, send commands to the Paradise server.

⚠️ **GitHub.com Fallback** ⚠️