Skip to content
Aaron J Yoder edited this page Jun 17, 2022 · 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. 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", and then click "Add Bot" on the right side. Confirm your choice. If it says that too many users have that name, just change the name and try again.
  6. Click "Reset token" and confirm your choice.
  7. Click "Copy" 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. Additionally, do not share this token with anyone.
  8. Optionally, you can give your bot an avatar on the "Bot" page, or change its name.

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, you need the application ID from earlier.
Invite link: https://discord.com/api/oauth2/authorize?client_id=APPLICATION_ID&permissions=0&scope=bot+applications.commands
You need to replace APPLICATION_ID with the application ID from earlier.
Once you've done that, copy the link and paste it into your browser. You will then be able to invite the bot to any servers you own.

Clone this wiki locally