This is a frontend for the doko-API Doppelkopf point counting suite in form of a Discord bot. Doppelkopf is a german card game, that is played with 4 players in 2 teams. The goal is to get as many points as possible over a series of rounds. More information about the game can be found here.
The doko-suite does not implement the game itself, but is only a tool to keep track of the points of the players over a game (usually 16 rounds), as well as saving all time statistic and visualizing this data.
You can find the server part here.
- Do the basic point counting for a doppelkopf game, with bockrounds and pflichtsolo
- Start games, keep track of the poins of each player over a series of rounds
- Visualize player statics over a game or over all time
- Implement the doko-API server to save the points long term
- Install the doko-API server from here. You can also find a docker-compose file there, which comes bundled with this bot you can use. Follow the setup steps for the prod.env file of the bot from here and the installation instructions of the API.
- Get the Discord bot token from the discord developer portal. Here is a guide.
- Make a bot channel in your discord server and get the channel id, to use it in the prod.env file.
- Fill in the following values in the prod.env file:
DISCORD_TOKEN=your_discord_token
DISCORD_CHANNEL_ID=your_discord_channel_id
API_URL=http://NAME_OF_YOUR_API_NGINX_CONTAINER/
JACCARD_THRESHOLD=0.9 # or leave emtpy
- Use one of the docker-compose files in the repo or customize it to your needs or proceed below with building the container yourself or docker run from here. Here is an example docker-compose:
version: '3.8'
services:
discord_bot:
image: valentin123/doko-discord-bot:latest
command: python main.py
env_file:
- ./prod.env
docker-compose up -d
- Connect the bot container to the same network as the API container, if you use the docker-compose file from the API repo, it should be done automatically.
git clone https://github.com/Ostviertelgang/doko-Discord-Bot.git
cd doko-Discord-Bot
- Then I prefer docker compose, but you can also just run the bot locally after installing the requirements, either just use the docker-compose.yml in the repo file or customize it from here:
version: '3.8'
services:
discord_bot:
build: ./
command: python main.py
env_file:
- ./prod.env
- Fill in the values in the prod.env file.
(You can find instructions above in the general installation steps) docker compose up -d
- Get a prod.env file and fill in the values as described above.
docker run -d --name discord_bot --env-file ./prod.env valentin123/doko-discord-bot:latest python main.py
Use !help
to get a list of all commands with a short description and usage information.
Some commands, such as the commands getting the points are only available in game.
!command [arg1,arg_1] [arg2] ...
!start player1,player2,player3,player4 game_name
winning_player1,winning_player2 points <optional: amount_of_bockrounds_caused> # for a normal game
winning_player points <optional: amount_of_bockrounds_caused> # for a solo
!points (-v for a graphical representation)
!bock # to get the current bockroundstatus
!pflichtsolo # to see which player still have their pflichtsolo to go.
!stop # close and commit the current game, get a summary plot of the game
!start Bob,Alice,Eve,Mallory just gaming, no spying
Bob,Alice 2 # Bob and Alice won and get 2 points, Eve and Mallory loose 2 points
Mallory,Eve 4 # Mallory and Eve won and get 4 points, Bob and Alice loose 4 points
Eve 2 # Eve played a solo, she gets 6 points, the others loose 2 points
!points # get the current points
Bob,Eve 12 1 # Bob and Eve won and caused a bockround
!bock # get the current bock status
!pflichtsolo # see who still has to play a solo
Bob,Alice 3 # Bob and Alice won and get 6 points (because of bockrunde), Eve and Mallory loose 6 points
!stop # close the game and display the summary plot