Repository navigation
Environment
There are two ways to run the bot.
Both require you to complete the steps on this page
-
Build the project, set up a mysql database, and
java -jar jarfilehere -
Build the project, change the .env variables, and
docker compose up
- gradle
- java-jdk:17+
- an empty or new mysql-database
- a discord-bot token from your Developer Portal
- A text editor. I use IntelliJ
I'll skip a tutorial on how to install gradle, java, and the text editor.
Clone the repository from Github. The master branch should always be in a functional state. Ask to be invited so you can push commits to the repository
From here, you can refresh gradle to sync the dependencies. There is a gradle menu on the top-right of IntelliJ. The refresh icon will sync gradle with the build.gradle file to sync the dependencies.
In the ./gradle.properties file, set the botsBuildDir= to the (possibly absolute) path location you want the shadowJar to build to. The folder ${botsBuildDir}/ambrosia will hold the generated configuration files later. Note that you can also set this variable in gradle.properties in GRADLE_USER_HOME
Run the gradle shadowJar task. It will build in the ./build directory, and copy to ${botsBuildDir}/ambrosia if you have it set. To run the shadowJar task. Using the menu specified in the Gradle Sync section of this tutorial, You can navigate the tree %ProjectName% > Tasks > shadow > shadowJar.
Head over to one of the following depending on how you plan to run the bot
After you've completed the steps in one of these guides, continue to the next section here for configuration.
Fill in the appropriate fields for the database connection in the generated ./Database/Config/Database.config.json.
Then change isConfigured to true, and DROP_THE_DATABASE_AND_RECREATE to true
Then run the bot again to generate more files. Again it should fail, but with a different warning
Fill in the appropriate fields for the discord bot in the generated ./Discord/Config/Discord.config.json. Refer to Developer Portal for your Bot token.
Fill in the appropritate fields in ./Discord/Config/Permissions.config.json as well.
You should be able to run the bot now! Remember to change DROP_THE_DATABASE_AND_RECREATE back to false