A Discord bot for Twilight Imperium 4th Edition, featuring faction randomization and more.
- Randomly select TI4 factions, optionally filtered by expansion/source
- Discord command interface
- Extensible bot architecture
- Clone the repository:
git clone https://github.com/fsharpasharp/TI4Botten.git cd TI4Botten - Install dependencies:
pip install -r requirements.txt
- Add your Discord bot token to a file named
.tokenin the project root.
Run the bot:
python app.pyThis project uses SQLAlchemy ORM with SQLite (app.db). Tables are auto-created on first run. See src/game/model.py for models.
Run all tests:
pytestTest coverage includes bot commands and faction logic. See tests/ and src/game/tests/.
app.py— Main entrypoint for the botsrc/bot.py— Bot and command definitionssrc/game/commands.py— Game-related Discord commands (uses ORM)src/game/factions.py— Faction logic and data loadingsrc/game/model.py— SQLAlchemy ORM modelssrc/game/tests/— Faction logic teststests/— Bot command tests
Pull requests and issues are welcome!