This is a Discord bot for the famous game Secret Hitler. Secret Hitler is a game like werewolf or mafia. Every player gets a secret role: Liberal, Fascist or Hitler. The fascists know each other and try to install their cold-blooded leader. The liberals try to find and stop the secret hitler before it's too late.
You need 5-10 players to play this game. You can see the rules here: Click here for the rules!
This code implements the game in a discord bot, so you can play this game in discord!
Note that this project is still in development. There will be more features and bugfixes soon.
This discord bot is made in Python using pillow and discord.py
Ensure the following tools and libraries are installed.
git
. git
is likely already installed on Unix or macOS, but you can get the latest command line git
at https://git-scm.com/downloads. If you prefer a GUI, https://desktop.github.com/ is GitHub's GUI client, and there are many other GUI wrappers around git
.pillow
, python-dotenv
, and discord.py
via
pip3 install pillow && pip3 install python-dotenv && pip3 install discord.py
You will need to create an application and bot on Discord at https://discord.com/developers/applications/ in order to generate an OAuth2 token for the SecretHitler app to send messages to the Discord API.
The application must be running for the Discord bot to be able to respond to commands from users in Discord. First, you must set up the code to use the OAuth2 token generated when you created the application on Discord's developer site. Open the "Bot" tab for the application on the Discord developer portal, and click the "Copy" button for the bot token, near the app icon.
In the home directory for the user that will run the application, create a .env
file if one does not already exist.
Add the following line to the .env
file:
SECRET_HITLER_DISCORD_TOKEN=<app token copied from developer portal>
Paste the copied token string after the =
and save the .env
file. The application will read the token from the environment
file.
Start the server by running:
python3 main.py
To start a game use -startgame private
https://discordpy.readthedocs.io/en/latest/index.html
This project is licensed under Creative Commons BY-NC-SA 4.0. You are free to adapt and share the game in any form or format under following conditions. You have to credit us if you use this game. You are not allowed to use the game for commercial use. You have to use the same license as we do (CC BY-NC-SA 4.0). You are not allowed to restrict others from doing anything our license allows. That means you can't submit the app to an app store without approval.
Secret Hitler was created by Mike Boxleiter, Tommy Maranges, Max Temkin, and Mac Schubert (see secrethitler.com). The graphics used for this project are from secrethitlerfree.de and made by Flatimalsstudios. The code used for this game is made by Nergon and also licensed under CC BY-NC-SA 4.0
I modified the images and slightly adjusted the rules for a better online use.