{"id":28950462,"url":"https://github.com/humblemonk/dicemaiden-rs","last_synced_at":"2026-04-28T17:02:03.443Z","repository":{"id":300451919,"uuid":"1005928788","full_name":"Humblemonk/dicemaiden-rs","owner":"Humblemonk","description":"Dice bot for Discord - now in rust!","archived":false,"fork":false,"pushed_at":"2026-04-27T14:59:15.000Z","size":1436,"stargazers_count":18,"open_issues_count":6,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T16:25:54.424Z","etag":null,"topics":["bot","d10","d20","d6","dark-heresy","deathwatch","dice","dice-bot","dicebot","discord","dnd","dnd5e","pathfinder","rogue-trader","roll-dice","rust","trpg","wod","wrathandglory"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Humblemonk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"patreon":"dicemaiden"}},"created_at":"2025-06-21T05:29:41.000Z","updated_at":"2026-04-27T15:00:51.000Z","dependencies_parsed_at":"2025-07-05T21:19:44.025Z","dependency_job_id":"90481df0-8928-40f3-9168-fe9de8c764a0","html_url":"https://github.com/Humblemonk/dicemaiden-rs","commit_stats":null,"previous_names":["humblemonk/dicemaiden-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Humblemonk/dicemaiden-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humblemonk%2Fdicemaiden-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humblemonk%2Fdicemaiden-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humblemonk%2Fdicemaiden-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humblemonk%2Fdicemaiden-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Humblemonk","download_url":"https://codeload.github.com/Humblemonk/dicemaiden-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humblemonk%2Fdicemaiden-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","d10","d20","d6","dark-heresy","deathwatch","dice","dice-bot","dicebot","discord","dnd","dnd5e","pathfinder","rogue-trader","roll-dice","rust","trpg","wod","wrathandglory"],"created_at":"2025-06-23T14:00:57.601Z","updated_at":"2026-04-28T17:02:03.437Z","avatar_url":"https://github.com/Humblemonk.png","language":"Rust","funding_links":["https://patreon.com/dicemaiden"],"categories":[],"sub_categories":[],"readme":"# DiceMaiden - Rust Edition\n\nA powerful Discord dice rolling bot written in Rust using the Serenity framework. This is a complete rewrite of the original [DiceMaiden](https://github.com/Humblemonk/DiceMaiden) Ruby bot, featuring all the same functionality with improved performance and memory safety.\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://top.gg/bot/377701707943116800\"\u003e\n    \u003cimg src=\"https://top.gg/api/widget/377701707943116800.svg\" alt=\"Dice Maiden\" /\u003e\n\u003c/a\u003e\n\n## Features\n\n- **Comprehensive Dice Rolling**: Support for complex dice expressions with modifiers\n- **Game System Aliases**: Built-in support for popular RPG systems\n- **Slash Commands**: Modern Discord integration with `/roll` and `/r` commands\n- **Advanced Modifiers**: Exploding dice, keep/drop, rerolls, success counting, and more\n- **Multiple Roll Types**: Single rolls, roll sets, and multi-roll expressions\n- **Message Management**: Purge command for cleaning up chat\n\n## Quick Install\n\n[**Click here to add Dice Maiden to your server**](https://discord.com/api/oauth2/authorize?client_id=572301609305112596\u0026permissions=274878000128\u0026scope=bot%20applications.commands)\n\nThis will authorize the bot for your server and you should see it in your default public channel. The bot will have permissions to read, send and manage messages.\n\n**Note:** It is recommended to review your app integration settings found under Server Settings \u003e Integrations. From here you can restrict the bot slash commands to specific channels\n\n## Commands\n\n- `/roll \u003cdice\u003e` - Roll dice using RPG notation\n- `/r \u003cdice\u003e` - Short alias for roll\n- `/help [topic]` - Show help (topics: basic, alias, system)\n- `/purge \u003ccount\u003e` - Delete recent messages (requires permissions)\n\n## Dice Rolling Syntax\n\n### Example Dice Roll\n\n![readme](https://github.com/user-attachments/assets/0371ff72-e3da-4400-9e1b-8063ef8554a7)\n\nSupported dice rolls and game systems can be [found here!](roll_syntax.md)\n\n**NOTE: USERS WILL NEED THE ROLE \"USE APPLICATION COMMANDS\" TO USE SLASH COMMANDS**\n\n## Local Instance Setup\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/Humblemonk/dicemaiden-rs.git\n   cd dicemaiden-rs\n   ```\n\n2. **Set up environment**\n   ```bash\n   cp env.example .env\n   # Edit .env and add your Discord bot token. review the other ENV variables found in this documentation\n   ```\n\n3. **Build and run**\n   ```bash\n   cargo build --release\n   cargo run\n   ```\n\n### Discord Bot Setup\n\n1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)\n2. Create a new application and bot\n3. Copy the bot token to your `.env` file\n4. Invite the bot to your server with the following permissions:\n   - Send Messages\n   - Use Slash Commands\n   - Manage Messages (for purge command)\n   - Read Message History\n\n**Invite URL Template:**\n```text\nhttps://discord.com/api/oauth2/authorize?client_id=YOUR_BOT_ID\u0026permissions=274878000128\u0026scope=bot%20applications.commands\n```\n\n## Configuration\n\n### Environment Variables\n- `DISCORD_TOKEN` - Your Discord bot token (required)\n- `GUILD_ID` - Guild ID for testing commands (optional)\n- `DATABASE_URL` - SQLite database path. Defaults to sqlite:main.db . This database is automatically created if it doesn't exist (optional)\n- `SHARD_COUNT` - Manual number of shards to use. Defaults to 1 for small bots (optional)\n- `USE_AUTOSHARDING` - Set to true to use discord recommended shard count. Defaults to false (optional)\n- `MAX_CONCURRENCY` - Max concurrent shard connections. Discord will override this with your bots actual limit (optional)\n- `RUST_LOG` - Log level (default: info)\n- `SHARD_START` - Starting shard ID for the process (needed for multi-process sharding)\n- `TOTAL_SHARDS` - Total shards across all processes (needed for multi-process sharding)\n\nYou can customize the build further by modifying `Cargo.toml` dependencies.\n\n## Development\n\n\n### Requirements\n- Rust 1.87+\n- Discord bot token\n- SQLite database (automatically created for bot statistics)\n- Dependencies - For a detailed list, review [Cargo.toml](Cargo.toml)\n\n### Building\n```bash\n# Development build\ncargo build\n\n# Release build\ncargo build --release\n\n# Run tests\ncargo test\n\n# Run with logging\nRUST_LOG=debug cargo run\n```\n\n### Project Structure\n```text\nsrc/\n├── main.rs             # Application entry point and Discord client setup\n├── database.rs         # SQLite database management for shard statistics\n├── help_text.rs        # Shared help text generation for all help commands\n├── lib.rs              # Shared libraries required for unit tests\n├── dice/\n│   ├── mod.rs          # Dice module exports and core types (DiceRoll, RollResult, etc.)\n│   ├── parser.rs       # Dice expression parsing and syntax validation\n│   ├── roller.rs       # Dice rolling execution and modifier application\n│   ├── rng.rs          # Enhanced cryptographically secure RNG with multiple entropy sources\n│   └── aliases.rs      # Game system aliases and expression expansions\n└── commands/\n    ├── mod.rs          # Command module exports and CommandResponse type\n    ├── roll.rs         # Roll command implementation with system info\n    ├── help.rs         # Help command with topic-based help system\n    └── purge.rs        # Message purge command with permission checking\n\ntests/\n├── unit_tests.rs           # Core dice logic, parsing, rolling\n├── game_systems_tests.rs   # All game system tests (consolidated)\n├── integration_tests.rs    # End-to-end functionality\n└── performance_tests.rs    # Performance and limit testing\n```\n\n## Deployment\n\n\n### Docker\n```dockerfile\nFROM rust:1.87-slim-bookworm as builder\n\n# Install build dependencies\nRUN apt-get update \u0026\u0026 apt-get install -y \\\n    pkg-config \\\n    libssl-dev \\\n    \u0026\u0026 rm -rf /var/lib/apt/lists/*\n\nWORKDIR /app\n\n# Copy manifest files first for better layer caching\nCOPY Cargo.toml Cargo.lock ./\n\n# Create dummy source to build dependencies\nRUN mkdir src \u0026\u0026 echo \"fn main() {}\" \u003e src/main.rs\nRUN cargo build --release \u0026\u0026 rm -rf src\n\n# Copy actual source code\nCOPY . .\n# Force rebuild of our code but reuse dependencies\nRUN touch src/main.rs \u0026\u0026 cargo build --release\n\nFROM debian:bookworm-slim\n\n# Install runtime dependencies\nRUN apt-get update \u0026\u0026 apt-get install -y \\\n    ca-certificates \\\n    sqlite3 \\\n    \u0026\u0026 rm -rf /var/lib/apt/lists/* \\\n    \u0026\u0026 useradd -m -u 1000 dicebot\n\nCOPY --from=builder /app/target/release/dicemaiden-rs /usr/local/bin/\n\n# Create data directory for SQLite database\nRUN mkdir -p /data \u0026\u0026 chown dicebot:dicebot /data\n\nUSER dicebot\nWORKDIR /data\n\nCMD [\"dicemaiden-rs\"]\n```\n\n### Systemd Service\n```ini\n[Unit]\nDescription=Dice Maiden\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=dicebot\nGroup=dicebot\nWorkingDirectory=/opt/dicemaiden-rs\nEnvironment=RUST_LOG=info\nEnvironmentFile=/opt/dicemaiden-rs/.env\nExecStart=/opt/dicemaiden-rs/target/release/dicemaiden-rs\nRestart=always\nRestartSec=10\nTimeoutStartSec=300\nTimeoutStopSec=120\n\n# Security hardening\nNoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nReadWritePaths=/opt/dicemaiden-rs/data\nPrivateTmp=true\n\n[Install]\nWantedBy=multi-user.target\n```\n### Multi-Process Sharding\n```bash\n# Example: 3 processes handling 64 shards total\n# Process 1: shards 0-20\nSHARD_COUNT=21 SHARD_START=0 TOTAL_SHARDS=64 ./dicemaiden-rs \u0026\n\n# Process 2: shards 21-41  \nSHARD_COUNT=21 SHARD_START=21 TOTAL_SHARDS=64 ./dicemaiden-rs \u0026\n\n# Process 3: shards 42-63\nSHARD_COUNT=22 SHARD_START=42 TOTAL_SHARDS=64 ./dicemaiden-rs \u0026\n```\n\n## Differences from Original\n\nThis Rust implementation maintains full compatibility with the original DiceMaiden's dice syntax while offering:\n\n- **Better Performance**: Rust's zero-cost abstractions and memory safety plus low memory utilization\n- **Modern Discord API**: Native slash command support\n- **Type Safety**: Compile-time guarantees prevent runtime errors\n- **Easier Deployment**: Single binary with no runtime dependencies\n- **Better Error Handling**: Comprehensive error messages and recovery\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code standards, and how to submit a pull request.\n\n## License\n\nThis project is licensed under the GPLv3 License\n\n## Acknowledgments\n\n- Original [DiceMaiden](https://github.com/Humblemonk/DiceMaiden) by Humblemonk and many awesome contributors!\n- [Serenity](https://github.com/serenity-rs/serenity) Discord library\n- The Rust community for excellent crates and documentation\n\n## Support\n\n- Create an issue for bugs or feature requests\n- Check the documentation for dice syntax questions\n- Join the [Discord community](https://discord.gg/AYNcxc9NeU) for help and discussion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumblemonk%2Fdicemaiden-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumblemonk%2Fdicemaiden-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumblemonk%2Fdicemaiden-rs/lists"}