This Discord bot allows you to display Dead by Daylight (DBD) player stats and items for Steam users. It supports multiple methods to set up and start the bot, including the Classic Method and Docker Method.
Commands, that only be used by the owner of the bot, can only be used in a DM with the bot. Write help
, to get a list of available owner commands.
- Retrieve player statistics for Dead by Daylight
- Display information about in-game items
- Supports multiple installation methods
- Integrates with MongoDB for data storage (optional)
- Translates with Google Cloud Translation, or LibreTranslate (optional)
- Ensure Python >=3.12 is installed. This bot was developed using Python 3.12.2. Download it here.
- Clone this repository or download the zip file.
- Open a terminal in the "DBDStats" folder where you cloned the repository or extracted the zip file.
- Run
pip install -r requirements.txt
to install the dependencies. - Open the file ".env.template" and complete all variables:
TOKEN
: The token of your bot. Obtain it from the Discord Developer Portal.OWNER_ID
: Your Discord ID.steamAPIkey
: Your Steam API key. Get your key from the Steam Community API page.support_server
: The ID of your support server. The bot must be a member of this server to create an invite if someone requires support.twitch_client_id
: The client ID of your Twitch app. Obtain it from the Twitch Developer Console.twitch_client_secret
: The client secret of your Twitch app. Obtain it from the Twitch Developer Console.libretransURL
: The URL of your LibreTranslate instance. -> If you don't want to use LibreTanslate, remove the variables containing 'libretrans'.libretransAPIkey
: The API key for the LibreTranslate instance.GOOGLE_APPLICATION_CREDENTIALS
: The path to your Google Cloud credentials file (optional).MongoDB_host
: The MongoDB host address. -> If you don't want to use MongoDB, remove the variables containing 'MongoDB'.MongoDB_port
: The MongoDB port number.MongoDB_user
: The MongoDB username.MongoDB_password
: The MongoDB password.MongoDB_database
: The MongoDB database name.
- Rename the file ".env.template" to ".env".
- Run
python main.py
orpython3 main.py
to start the bot.
If you have cloned the repository, you will find two Docker Compose files in the DBDStats/Docker-compose
folder. The regular version includes MongoDB (recommended), while the "docker-compose_without_MongoDB" version contains only the bot without MongoDB.
-
Make sure Docker and Docker Compose are installed. Download Docker here and Docker Compose here.
-
Navigate to the
DBDStats/Docker-compose
folder where you cloned the repository or extracted the zip file.
-
Open the
docker-compose.yml
file and update the environment variables as needed (such assteamAPIkey
,support_server
,TOKEN
,OWNER_ID
,twitch_client_id
, andtwitch_client_secret
). -
In the terminal, run the following command from the
DBDStats/Docker-compose
folder to start the bot with MongoDB:docker-compose up -d
-
Open the
docker-compose_without_MongoDB.yml
file and update the environment variables as needed (such assteamAPIkey
,support_server
,TOKEN
,OWNER_ID
,twitch_client_id
, andtwitch_client_secret
). -
In the terminal, run the following command from the
DBDStats/Docker-compose
folder to start the bot without MongoDB: docker-compose -f docker-compose_without_MongoDB.yml up -d
- Ensure Docker is installed. Download it from the Docker website.
- Clone this repository or download the zip file.
- Open a terminal in the "DBDStats" folder where you cloned the repository or extracted the zip file.
- Run
docker build -t dbdstats .
to build the Docker image.
- Ensure Docker is installed. Download it from the Docker website.
- Open a terminal.
- Run the bot with the command below:
- Modify the variables according to your requirements.
- Set the
steamAPIkey
,TOKEN
, andOWNER_ID
. - Variables containing 'twitch' are for the Twitch command. Remove them if you don't want to use this command.
- The
libretransURL
variable is for translating output. Remove it if you don't need it. - The
libretransAPIkey
variable is the API key for the LibreTranslate instance set in thelibretransURL
variable. - The
GOOGLE_APPLICATION_CREDENTIALS
variable is the path to your Google Cloud credentials file (optional). - Variables containing 'MongoDB' are for storing the bot's data. Remove them if you don't want to use MongoDB.
You only need to expose the port -p 5000:5000
, if you want to use an external tool, to test, if the bot is running.
You need to call the /health
endpoint.
docker run -d \
-e steamAPIkey=STEAM_APIKEY \
-e support_server=ID_OF_SUPPORTSERVER \
-e TOKEN=BOT_TOKEN \
-e OWNER_ID=DISCORD_ID_OF_OWNER \
-e twitch_client_id=twitch_client_id \
-e twitch_client_secret=twitch_client_secret \
-e libretransURL=https://YOUR_INSTANCE_OF_LIBRETRANS \
-e libretransAPIkey=APIkey_for_instance_of_libretrans \
-e MongoDB_host=IP_OR_DOMAIN_OF_MONGODB \
-e MongoDB_port=PORT_OF_MONGODB \
-e MongoDB_user=USER_OF_MONGODB \
-e MongoDB_password=PASSWORD_OF_MONGODB \
-e MongoDB_database=DATABASE_OF_MONGODB \
-e GOOGLE_APPLICATION_CREDENTIALS=/path/to/googleauth.json \
--name DBDStats \
--restart any \
--health-cmd="curl -f http:https://localhost:5000/health || exit 1" \
--health-interval=30s \
--health-timeout=10s \
--health-retries=3 \
--health-start-period=40s \
-p 5000:5000 \
-v dbdstats_log:/app/DBDStats/Logs \
-v /path/to/googleauth.json:/app/googleauth.json:ro \
serpensin/dbdstats