🎲 A Discord bot for performing Dungeons and Dragons 5th Edition dice rolls.
See Command Reference for examples of natural language commands supported by Dungeon Helper.
In the Discord Developer Portal:
-
Create a "New Application" in the Discord Developer Portal.
-
Under the "Bot" tab, create a new Bot user. Set its name and icon appropriately. Take note of the "Token".
-
Under the "OAuth2" tab, in the "Scopes" section select the "bot" scope, and in the "Bot Permissions" section select the "Send Messages" permission. Copy the URL that appears below. It should have the form:
https://discordapp.com/api/oauth2/authorize?client_id=012345678912345678&permissions=2048&scope=bot
The
client_id
should match the "Client ID" of your application, found under the "General Information" tab. -
Go to the URL. Use the form to authorise the bot to join a server that you manage.
See separate README.
In a local command-line environment:
-
Build the application with Cargo.
cargo build --release
-
Set environment variables:
DISCORD_TOKEN
to the bot token noted before.DATABASE_PATH
to the path of a SQLite database, initialised with the SQL schema in./config/sql/
.MODEL_PATH
to the path of a trained Snips NLU model.DICTIONARY_PATH
to the path of a SymSpell frequency dictionary.BIGRAM_DICTIONARY_PATH
to the path of a SymSpell bigram frequency dictionary.RUST_LOG=dungeon_helper=info
to enable logging.
-
Run the application.
./target/release/dungeon_helper
In a Discord server that the bot has joined:
- Type
!help
for usage instructions. - Type
!roll 1d20
to roll one 20-sided die. - Type
!roll 2d8 + 4
to roll two 8-sided dice with a modifier of +4 (i.e. adding 4 to the sum of the two dice). - Type
!roll 1d20 + 5 with advantage
to roll one 20-sided die with a modifier of +5 with advantage (taking the highest of two rolls). - Type
!roll 1d20 - 1 with advantage
to roll one 20-sided die with a modifier of -1 with disadvantage (taking the lowest of two rolls).