-
-
Notifications
You must be signed in to change notification settings - Fork 1
Self‐hosting
Table of contents: Self-hosting
This bot relies on a bunch of stuff to work. Here's a list of all required (and optional) things to install:
| Dependency | Why? | Optional |
|---|---|---|
| Lavalink server | This is required for the bot to be able to play music from different sources | ❌ |
| NodeJS | Required to run the typescript code | ❌ |
| Postgres database | This is only required if you want the bot to store statistics (like sessions count) | ❌ |
Tip
If you don't have a Postgres database or just don't want to use one, you can set the database key inside of config.yml to sqlite to use a local sqlite3 database instead!
Caution
You must use version 3.x.x of lavalink!
Warning
The Lavalink server must be running in the background while the bot is online!
Due to how poru works if the bot disconnects from Lavalink it WILL crash after a couple of attempts to reconnect.
- If you don't have it yet install Java JDK 17, then check if Java installed successfully by opening a terminal window and typing in
java --version - Go to the lavalink repository and download the lavalink
.jarfile - Make sure lavalink works by running it with the
java -jar path_to_lavalink.jarcommand
- Go to the Node JS download page and install the LTS version (preferably 18.x)
- To test if node.js is installed correctly open a new terminal window and input the
node --versioncommand
- Go to the discord developer portal and create a new application
- Create a new bot for your application and copy the token
- Rename the
config.example.ymlfile toconfig.ymlinstead - Paste the bot token into the
config.ymlfile
Tip
Instead of cloning the code using git you can download the ZIP file from the main repo's page
- Clone the source code with
git clone https://github.com/Reishimanfr/The-World-Machine-Bot(or just download the ZIP file) - Go into the newly created directory "The-World-Machine-Bot"
- Run
npm install --omit=dev
Warning
You must set the playerUpdate option in application.yml to 1s! Explanation available here
- Copy the example
application.ymlfile from the lavalink's website and place it in the project's root folder (the same one where you can findpackage.json. Change thepasswordfor the lavalink server. - Go to the
config.ymlfile and fill it out with the required stuff. To see what's required check this page - Go to the
src/config.tsfile and define a lavalink node inside theporuNodesarray.
Warning
If you change the autocomplete option in config.yml, you must rerun the deploy script!
- After filling out the
config.ymlfile run thenpm run deploycommand to register (/) commands globally. - Run the
npm run startcommand to start the app after making sure lavalink is running