This project is designed to fully automate the adjudication of Diplomacy games over Discord. The step-by-step process to use this bot will be outlined in the near future.
Current limitations:
- The only variant you may play at this time is Imperial Diplomacy. An interface for easily adding variants will be added in the near future.
If you find any bugs or inconsistencies or wish to see new features (for game-running work you would rather not do yourself or rather not subject your players to), please message icecream_guy on Discord.
You should use virtual environments to manage python packages.
To clone the repo and install dependencies, run the following on the Command Line (example commands are for Ubuntu 24.04) -
#Clone the bot locally
git clone https://github.com/Imperial-Diplomacy/DiplomacyGM.git
cd DiplomacyGM
#Create virtual environment
virtualenv venv -p=3.12
#Start virtual environment
source venv/bin/activate
#This installs all the python dependencies the bot needs, only needed once.
pip install -r requirements.txt
#Copies
cp config_defaults.toml config.toml
# Now edit config.toml and add the right inputs#Start virtual environment
source venv/bin/activate
#Run the bot
python main.py
#Stop virtual environment
deactivateUse .help on your server to test the bot works. It also lists all the commands available.
GM commands such as .create_game can only be used if you have a "GM role". This is any role with the name "heavenly angel", "gm" etc (See bot/config.py for full list)
GM commands can also only be called in a channel named "admin-chat" in "gm channels" category.
Player commands can only be called in "orders" category in channels named "france-orders" etc.
When you make commits, add your changes to Changelog.md.
Please ensure version numbers are correct and underlined with = characters at the start of each version's release notes in the changelog. The bot uses them to detect the versions and its release notes.
Please also ensure each set of release notes has a Released: <DATE> near the start.
Then, it is suggested to split into the following sections but use your own judgement:
- A section each set of major changes/features.
- Changes only affecting GMs
- Changes only affecting Developers and/or superusers
- Most under the hood bugfixes and minor code changes should end up here
Versioning loosely follows Semantic Versioning. Here's the brief overview:
Given a version number MAJOR.MINOR.PATCH, increment the:
1. MAJOR version when you make incompatible API changes
2. MINOR version when you add functionality in a backward compatible manner
3. PATCH version when you make backward compatible bug fixes
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
For our purposes our API counts as our forward facing commands: any method to interact with our systems by non-superusers.
To release a new version you must:
- Be a superuser.
- Have Github access.
- Have VPS access.
To release a new version:
-
Ensure the changelog has the release notes for the new version.
-
Ensure the dev branch has been suitably tested.
-
Create a PR to merge
devintomain. (you can do this ahead of time).- This will require approval from 2 contributors
- Please ensure the dev branch has been suitably tested.
-
Create a version tag with the semantic version eg
1.0.0NOTv1.0.0 -
On the server use
cd /opt/DiplomacyGMfollowed bygit fetch && git checkout <Version>eggit fetch && git checkout 1.0.0- This drops local changes to unstaged tracked files (Not the database or config.toml)
-
Run the bot command
.shutdown_the_bot_yes_i_want_to_do_thisto shutdown the bot -
On the server run
sudo systemctl restart DiploGM.service -
Monitor the Bot and ensure it restarts correctly.
On occasion, it may be required to push a change out faster than this process allows. If this is the case the version and changes should be documented after the fact. A full process for this is not currently documented.