Skip to content
Aaron J Yoder edited this page Sep 9, 2023 · 11 revisions

This page will walk you through the process of getting everything set up to self-host the bot.

Installing Java

You will need to have the JDK installed in order to run the bot.
You can download the JDK from your preferred vendor via the Adoptium Marketplace.
You must use JDK version 17 or later.

Setup with Discord

You will need to create a new application and register it as a bot with Discord. In order to do that, go to the Developers section of the Discord website. You can do this manually by going to the Discord website, scrolling to the bottom, and clicking "Developers" in the footer area, then clicking "Get Started" under "Apps" on the page it takes you to. Make sure you are signed in before doing this.

Once there, follow these steps:

  1. Click "Applications" on the left side, near the top.
  2. On the right side near your avatar, click "New Application".
  3. Name it whatever you like and then click "Create".
  4. Make note of the "Application ID", you will need it later.
  5. On the left side, click "Bot". You can set the name and avatar here.
  6. Click "Reset token" and confirm your choice.
  7. Click "Copy" in order to copy the token and either paste it in a temporary notepad, or keep it in your clipboard for the next step. You cannot view the token again once you leave this page. Do not lose it. Do not share it.

Congratulations! You've made a bot. Now you need to set some things up locally.

Local Setup

Download the latest release from the Releases page of this GitHub.
Once you've done that, follow these steps:

  1. Unzip the file.
  2. Go to the following directory within the unzipped file: res/auth/
  3. Right-click the auth.json file and open with Notepad, or your favorite text editing program.
  4. Inside this file, replace TOKEN with the bot token you copied earlier. Do not erase the quotes around it.
  5. Copy the application ID from earlier and replace CLIENT_ID with the application ID. Again, do not erase the quotes around it.
  6. Replace OWNER_ID with your Discord user ID. This is NOT Name#0000, it is an ID that looks similar to the application ID you just pasted above.
  7. In order to find your user ID, go into the Discord client, go to User Settings, go to Advanced, turn on "Developer Mode", and then exit user settings.
  8. Right-click on your username somewhere within Discord. This can be a message you sent, or the member sidebar in a server. Click "Copy ID". You now have your Discord user ID copied to your clipboard, and you can go back to step 6 and complete it.
  9. Save the auth.json file and exit.

In order to register the bot commands with Discord, follow these steps after following the steps above:

  1. Go to the res/config/bot/ directory.
  2. Open config.json in your favorite text editor.
  3. On the registerCommandsOnStartup value, change false to true.
  4. Save the config.json file and exit.

Running the bot

Windows

Right-click the run.ps1 file in the main directory and hit "Run with PowerShell". If you've completed all the previous steps properly, it should give you some text output in a command line window that says something about registering commands with Discord. Keep in mind that it may take up to one hour for commands to be visible within the Discord client.

Linux

You can either install PowerShell on Linux and run the run.ps1 file with PowerShell, or you can run java -jar RiskriegBot-x.y.z.jar in the terminal if you do not want to install PowerShell.

Inviting the bot

In order to invite the bot, go back to the Discord developer portal page, then follow these steps:

  1. Click "OAuth2" on the left side.
  2. Click on "URL Generator" on the left side.
  3. Under "Scopes" check "bot".
  4. Under "Scopes" check "applications.commands".
  5. Under "Bot Permissions" check the following:
    • Read Messages/View Channels
    • Send Messages
    • Send Messages in Threads
    • Attach Files
    • Use Slash Commands
  6. Go down to "Generated URL" and click "Copy".

You can then paste that link into your browser and invite the bot to any servers you own.

Clone this wiki locally