-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
This page will walk you through the process of getting everything set up to self-host the bot.
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.
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:
- Click "Applications" on the left side, near the top.
- On the right side near your avatar, click "New Application".
- Name it whatever you like and then click "Create".
- Make note of the "Application ID", you will need it later.
- On the left side, click "Bot". You can set the name and avatar here.
- Click "Reset token" and confirm your choice.
- 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.
Download the latest release from the Releases page of this GitHub.
Once you've done that, follow these steps:
- Unzip the file.
- Go to the following directory within the unzipped file:
res/auth/
- Right-click the
auth.json
file and open with Notepad, or your favorite text editing program. - Inside this file, replace
TOKEN
with the bot token you copied earlier. Do not erase the quotes around it. - Copy the application ID from earlier and replace
CLIENT_ID
with the application ID. Again, do not erase the quotes around it. - 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. - 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.
- 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.
- Save the
auth.json
file and exit.
In order to register the bot commands with Discord, follow these steps after following the steps above:
- Go to the
res/config/bot/
directory. - Open
config.json
in your favorite text editor. - On the
registerCommandsOnStartup
value, changefalse
totrue
. - Save the
config.json
file and exit.
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.
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.
In order to invite the bot, go back to the Discord developer portal page, then follow these steps:
- Click "OAuth2" on the left side.
- Click on "URL Generator" on the left side.
- Under "Scopes" check "bot".
- Under "Scopes" check "applications.commands".
- Under "Bot Permissions" check the following:
- Read Messages/View Channels
- Send Messages
- Send Messages in Threads
- Attach Files
- Use Slash Commands
- 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.