This is the main repository for the Discord D&D Game Master Bot project.
The principal concept behind it is to open up an opportunity to play a game similar to Dungeons & Dragons with your friends directly on Discord - without the aid of any external apps or installations.
Below you will find some information on running the bot locally
python 3.8
or higherdocker
Note: This guide assumes the database server is up and running.
-
Clone the repository and
cd
into the main directory -
Initialize the
database
anddocs
submodulesgit submodule update --init --recursive
-
Create a file which will contain all environment variables (secrets)
touch .env
Exemplary
.env
file contents, with all available variables:BOT_TOKEN=qwertyuiop # Discord bot access token DB_NAME=dndbot # Postgres database name DB_ADDRESS=127.0.0.1 # Database server IP address DB_PORT=1234 DB_USER=user # Authentication DB_PASSWORD=some_password
You will need to provide some correct values here, of course.
-
Getting the docker image
Here you can either:
- Use a prepared image
docker pull ghcr.io/esoviscode/discord-bot:latest
- Build one from local sources:
docker build . -t dndbot-dev
- Use a prepared image
Note: This guide assumes the docker image name is
ghcr.io/esoviscode/discord-bot:latest
Run the bot:
docker run -d --env-file .env ghcr.io/esoviscode/discord-bot:latest
This will run the
python
app in the background (-d
), utilizing environment variables provided in.env
(--env-file
)
After a few seconds the bot should be online, you can test if it works correctly
by running /hello
on Discord.
You can see if something went wrong using:
docker logs <app name>
Name of the app can be found using
docker container ls