https://github.com/johncmanuel/dndbot
Discord helper bot to help with future DnD sessions on Discord
https://github.com/johncmanuel/dndbot
deno dice-roller discord dnd
Last synced: about 2 months ago
JSON representation
Discord helper bot to help with future DnD sessions on Discord
- Host: GitHub
- URL: https://github.com/johncmanuel/dndbot
- Owner: johncmanuel
- License: mit
- Created: 2024-04-20T04:49:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T21:13:20.000Z (about 2 years ago)
- Last Synced: 2025-02-03T19:59:20.183Z (over 1 year ago)
- Topics: deno, dice-roller, discord, dnd
- Language: TypeScript
- Homepage: https://dndbot.deno.dev/invite
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# DnD Discord Bot
Discord helper bot to help with future DnD sessions on Discord
## TODO
1. Make commands for most commonly used dice rolls (i.e checks, saving throws, attack rolls, etc)
2. Refactor duplicate code
3. Work on processing multiple, comma-separated dice expressions (i.e 3d8+2, 1d20+1, etc.)
4. Create an auto-updating GitHub wiki page for all slash commands using a GitHub action and Discord API
## Setup
1. Install [Devbox](https://github.com/jetify-com/devbox)
2. [Setup your Discord application](https://discord.com/developers/docs/intro)
3. Setup environment variables in a `.env` file
```
DISCORD_APPLICATION_ID=""
DISCORD_PUBLIC_KEY=""
DISCORD_TOKEN=""
```
4. Create an account at [ngrok](https://ngrok.com/), which will be used to expose the local development server to Discord
5. Use `deno task ngrok` and `deno task start` in two separate terminals; one will be for ngrok and another for the server respectively
6. Use the URL given in the `ngrok` terminal under `Forwarding` that points to localhost as the `Interactions Endpoint URL` in your Discord application (change the URL with your production URL when switching to production)
7. Invite the bot to your server at the `/invite` endpoint and you're done :)
## Commands
## /dnd dice roll
Arguments: (dice-expression) (advantage-or-disadvantage) (comment)
Example usage:
```
# The bot uses Discord's built-in slash commands
/dnd dice roll 3d8
/dnd dice roll 1d20+8 advantage
/dnd dice roll 8d4+4 disadvantage
/dnd dice roll 1d20 "wisdom check"
/dnd dice roll 1d20+2 advantage "arcana check on deciphering writing in ancient spellbook"
```
## Credits
1. [Ethan](https://github.com/EthanThatOneKid) for making a goated Deno library: [discord_app](https://github.com/EthanThatOneKid/discord_app)