It is designed for two modes of play: players can join and play through Discord or browser chat, while dungeon masters and operators can manage campaigns, game data, and world state from the web UI.
- Persistent characters, sessions, combat, quests, spells, skills, and inventory
- Real gold balance handling, including player-to-player gold transfer
- AI DM narration, NPC dialogue, and tool-driven gameplay flow
- Browser chat with shared session state and live dashboard panels
- Web admin tools for campaigns, locations, NPCs, items, spells, and game data
- Discord responses are routed through the session-bound game channel and current session context
- Content-pack aware runtime data for themed campaigns
For setup, hosting, and environment configuration, see the Operator Guide.
rpg-dm-bot/
├── run.py # Entry point
├── requirements.txt # Dependencies
├── .env # Environment variables (not in repo)
├── .gitignore # Git ignore file
├── data/
│ ├── rpg.db # SQLite database (created at runtime)
│ └── game_data/ # Static game data (classes, races, items)
├── logs/ # Log files
├── src/
│ ├── bot.py # Main bot class
│ ├── database.py # Database operations
│ ├── llm.py # LLM integration
│ ├── prompts.py # System prompts
│ ├── tools.py # Tool executor
│ ├── tool_schemas.py # Tool definitions
│ └── cogs/
│ ├── characters.py # Character management
│ ├── combat.py # Combat system
│ ├── inventory.py # Inventory management
│ ├── quests.py # Quest system
│ ├── npcs.py # NPC interactions
│ ├── dice.py # Dice rolling
│ ├── spells.py # Spells, spell slot management, and casting UI
│ ├── sessions.py # Session management
│ ├── dm_chat.py # AI chat/narration
│ └── game_master.py # Game flow management
└── tests/ # Unit tests
Contributions are welcome. Please open an issue or pull request if you find a bug or want to improve the project.
MIT License. See the repository license for details.