More information in the configuration chapter.
This discord bot allows you to display the player count of your Battlefield 4 ,Battlefield Hardline and BattleBit Remastered servers on discord. Furthermore, the bot also displays the current map and changes its status according to the current population (Online, AFK, DND).
The bot may be run within a container, in a venv, or directly on a host.
- clone the repository
- adjust docker-compose.yml with your settings
(See chapter: Configuration)
vim docker-compose.yml
- bot token and server guid are needed
- create an own service for each bot in the docker-compe.yml
- sudo docker-compose up -d
The bot is not daemonized. It is recommended to use the docker image!
-
You only need the folder src.
-
(optional) switch to a venv
-
Install dependencies
cd src pip3 install --user -r requirements.txt
-
Edit the configuration or set environment variables (See chapter: Configuration)
-
Run the bot from the src folder with
python3 runBF4StatusBot.py -c PATH_TO_CONFIG_FOLDER
- sudo docker-compose down --rmi all
- git pull
- sudo docker-compose up -d
- BF4STATUSBOT_BOT_TOKEN
- Discord Bot Token
- BF4STATUSBOT_SERVER_GUID or BF4TATUSBOT_SERVER_NAME
- GUID of the BF4/BFHL server.
- Name/Regex for matching your BattleBit server.
- Both parameters have the same logic. Choose one.
- BF4STATUSBOT_GAME
- Default: BF4/BFHL
- Set the variable to
BBR
for BattleBit support.
- BF4STATUSBOT_CHECK_MAP=true
- Boolean
- Should the bot also display the current map?
- BF4STATUSBOT_INTERVAL_PRESENCE_CHANGE=5
- seconds (int)
- The interval for presence changes.
- BF4STATUSBOT_INTERVAL_DATA_FETCH=60
- seconds (int)
- The interval for sending requests to Battlelog and the BattleBit API.
You can also use configuration files.
Each bot requires its own config.
- Use environment variables for each container/bot.
- Use an env file and bind it to the container. (See docker documentation)
- Bind config directory
- Bind the container directory
/usr/src/app/config
to your docker host. - Modify
default.toml
or copyuser.toml.example
touser.toml
.
- Bind the container directory
- Bind config file
- Copy the file
cp src/config/user.toml.example server_1.toml
. - Bind the file to
/usr/src/app/config/user.toml
- Copy the file
This project is free software and licensed under the GPLv3.