Before creating your own instance, please note that you can add the bot to your server through the link available on the bot's discord
If you decide to work on the creation of your own instance of the bot, you are supposed to have a minimum of computer skills. Bot support team will prioritize players of the main instance and will only provide very limited assistance. We will fix bugs you report, but we will not teach you how to code a discord bot.
Please do not copy and paste the commands we provide in this readme without :
Only the code available in the "release" tab is considered "stable".
For development, we recommend that you run the bot on your computer. This way, you can test your changes without having to build the docker image each time you make a change. However, we still recommend you to use docker for the database, as it is easier to setup and maintain.
We provide all the necessary guides below. If you have any questions, feel free to ask them on our discord server.
git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure
nvm install
to install the correct version If you don't have nvm already install, you can use npm install -g nvm
to install itnpm install --global yarn
yarn install
yarn start
apt-get install git
git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure
apt-get install nodejs
apt-get install npm
nvm install
to install the correct version If you don't have nvm already install, you can use npm install -g nvm
to install itnpm install -g yarn
(you may have to install npm and use sudo)yarn install
cp config/config.default.toml config/config.toml
yarn start
yarn install
and yarn start
each time you update the bot.Make sure to have docker installed on your machine. Here is a link to the windows installation guide : https://docs.docker.com/desktop/install/windows-install/ Here is a link to the linux installation guide : https://docs.docker.com/engine/install/ubuntu/
Please follow the "without docker" steps until the yarn install
step (you don't need to do it).
This step is only necessary if you want to compile the image yourself. You do not need to do this for the bot to work. This is only if you want to deploy your own image to a server. We have a docker hub account, so you may not need to compile the image yourself! You can find it there: https://hub.docker.com/u/draftbot. If you really want to compile it yourself, follow the next step.
In the project folder (previously downloaded with git), run:
docker build . -t draftbot/draftbot
First, you will need to create a new folder to store the database data. We recommend you to create a folder outside of the project folder, to avoid any issues with git. Copy the path of this folder, you will need in the following command. This is the "path/to/volumes/mariadb"
Create a docker mariadb database with the following command :
docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret_password -e MARIADB_ROOT_PASSWORD=super_secret_password -v /path/to/volumes/mariadb:/var/lib/mysql -p 3306:3306 mariadb:latest
or with docker compose :
services:
mariadb:
image: mariadb
container_name: mariadb
ports:
- 3306:3306
volumes:
- /path/to/volumes/mariadb:/var/lib/mysql
environment:
MARIADB_USER: draftbot
MARIADB_PASSWORD: secret_password
MARIADB_ROOT_PASSWORD: super_secret_password
You can also just run a local mariadb server, but we recommend you to use docker. If you want more information about how to install mariadb, you can visit their website : https://mariadb.org/download/
Building or downloading a docker image of the bot is the recommended way to set up DraftBot in production.
You need to have a config.toml file filled. The config template can be found at config/config.default.toml
Here is the command that will start the DraftBot docker container:
docker run -d --name draftbot -v /path/to/config.toml:/draftbot/config/config.toml:ro -v /path/to/logs:/draftbot/logs draftbot/draftbot
or with docker compose :
services:
draftbot:
image: draftbot/draftbot
container_name: draftbot
volumes:
- /path/to/config.toml:/draftbot/config/config.toml:ro
- /path/to/logs:/draftbot/logs