A powerful D&D Discord bot designed for seamless remote gameplay. MythicMate provides intuitive dice rolling, comprehensive rules referencing, and AI-powered assistance, all optimized for speed and ease of use.
- Simple Syntax: Accepts any dice notation with automatic parsing (e.g.,
2d20 + 1d6 + 5) - Forgiving Input: Handles spaces and typos gracefully, rolling recognized dice while alerting you to errors
- Detailed Results: Shows individual die results for dramatic effect
- Multiple Roll Types:
/roll- Standard dice rolling/rolladv- Roll with advantage/rolldisadv- Roll with disadvantage/rollgwf- Great Weapon Fighting (reroll 1s and 2s)/rollempower- Sorcerer Empowered Spell (reroll dice below a threshold)
- Fast Lookups: Lightning-fast autocomplete suggestions for spells, conditions, feats, and more
- Offline Access: All data stored locally for instant responses
- Commands:
/spell- Look up spell details/conditions- View condition descriptions/feat- Search feats/lineage- Browse lineage options/class- View class information/subclass- Look up subclass details/damages- Reference damage types/cover- Cover rules
- ChatGPT Powered:
/askcommand for complex rule questions - Contextual Answers: Precise, pre-formatted prompts ensure relevant D&D responses
- Multithreaded: AI requests run on separate threads to keep the bot responsive
- Auto-Update:
/updatecommand scrapes D&D wikis for the latest content - Password Protected: Secured to prevent unauthorized database updates
- Pre-Formatted: Scraped data stored in Discord Markdown format for instant display
- Docker and Docker Compose installed
- Discord Bot Token (Create one here)
- OpenAI API Key (for
/askcommand) - A password for the
/updatecommand
-
Clone the repository:
git clone https://github.com/chase-roohms/mythicmate.git cd mythicmate -
Create a
.envfile in the project root:MYTHICMATE_TOKEN=your_discord_bot_token_here MYTHICMATE_PASSWORD=your_update_password_here MYTHICMATE_GPT_KEY=your_openai_api_key_here
-
Start the bot:
docker-compose up -d
-
View logs:
docker-compose logs -f
-
Stop the bot:
docker-compose down
The docker-compose.yml file is pre-configured with:
- Automatic Restarts: Bot restarts if it crashes
- Persistent Database:
./databasedirectory mounted for data persistence - Environment Variables: Loaded from
.envfile - Security: Runs as non-root user
If you want to build the Docker image locally instead of using the pre-built image:
-
Modify docker-compose.yml:
services: mythicmate: build: . # Instead of using image: neonvariant/mythicmate:main container_name: mythicmate-bot # ... rest of config
-
Build and run:
docker-compose up -d --build
- Java 21 (Eclipse Temurin recommended)
- Maven 3.8+
-
Clone the repository:
git clone https://github.com/chase-roohms/mythicmate.git cd mythicmate -
Set environment variables:
export MYTHICMATE_TOKEN=your_discord_bot_token export MYTHICMATE_PASSWORD=your_update_password export MYTHICMATE_GPT_KEY=your_openai_api_key
-
Build the project:
mvn clean package
-
Run the bot:
java -jar target/MythicMate-1.0-SNAPSHOT.jar
mythicmate/
├── src/main/java/
│ ├── Bot/ # Main Discord bot entry point
│ ├── Events/ # Command manager and autocomplete
│ ├── ICommands/ # Slash command implementations
│ │ └── Roll/ # Dice rolling commands
│ ├── Functions/ # Utility functions
│ ├── Database/ # Database management
│ ├── Scrapers/ # Web scraping utilities
│ ├── ICommandsHelpers/ # Command helper classes
│ └── Authenticate/ # Environment variable handling
├── database/ # Persistent data (created at runtime)
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Docker Compose configuration
├── entrypoint.sh # Container entrypoint script
└── pom.xml # Maven configuration
- JDA 5.0.0 - Java Discord API
- JSoup 1.16.2 - HTML parsing for web scraping
- Apache Commons Lang 3.18.0 - Utility functions
- dotenv-java 3.0.0 - Environment variable management
- SLF4J 2.0.9 - Logging framework
- Bot runs as non-root user in Docker container
- Environment variables used for sensitive data (tokens, keys)
/updatecommand password-protected- No exposed ports (Discord bot uses WebSocket)
| Command | Description |
|---|---|
/roll [dice] |
Roll dice with standard notation |
/rolladv [dice] |
Roll with advantage |
/rolldisadv [dice] |
Roll with disadvantage |
/rollgwf [dice] |
Roll with Great Weapon Fighting |
/rollempower [dice] [threshold] |
Roll with Empowered Spell |
/spell [name] |
Look up spell details |
/conditions [name] |
View condition information |
/feat [name] |
Search for feats |
/lineage [name] |
Browse lineage options |
/class [name] |
View class information |
/subclass [name] |
Look up subclass details |
/damages |
Reference damage types |
/cover |
View cover rules |
/ask [question] |
Ask ChatGPT a D&D question |
/update [password] |
Update database from web sources |
/commandlist |
List all available commands |
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the terms in the LICENSE file.
Remote D&D sessions deserve a bot that just works. No complex syntax, no paywalls, no account linking—just fast, intuitive commands that keep your game flowing. Whether you're rolling for initiative or looking up a spell mid-combat, MythicMate has your back.
Built with ☕ and ⚔️ by chase-roohms
