Your Comprehensive Dungeons and Dragons 5E Companion in Discord! Elevate your gaming experience by seamlessly rolling dice, exploring an arsenal of powerful weapons, discovering formidable beasts for your party to conquer, and much more—all conveniently within your Discord server! Powered by Discord JS and Open5E.
- NodeJS version 18.x or higher
- Git
- Discord Account
-
Clone the repository
Open your terminal and run the following command:
git clone https://github.com/bryanreiter/DNDiscord.git
-
Navigate to your project directory
cd DNDiscord
-
Install dependencies
npm install
-
Create a Discord Application
- Navigate to the Discord Developer Portal.
- Set the application name, description, and avatar.
- Note down the "Client ID"
-
Create and Configure Your Bot
- In the Discord Developer Portal, select "Bot" from the left navigation
- Set a name and icon for your bot.
- Note down the "Bot Token"
-
Add Bot to Your Server
- Go to the application page in the Discord Developer Portal.
- Navigate to 'OAuth' -> 'URL Generator'.
- Check 'applications.commands' and 'bot'
- Open the URL that populates at the bottom and authorize the bot to access your server.
-
Enable Developer Mode on Discord
- Enable "Developer Mode" under the "Advanced" settings tab on your Discord client.
- Right-click on the server icon, and select "Copy ID" to get the server ID.
-
Configure Environment Variables
Create a
.env
file in your project root and add your client ID, server ID, and bot token:TOKEN=<YOUR-BOT-TOKEN> CLIENTID=<YOUR-CLIENT-ID> GUILDID=<YOUR-SERVER-ID>
-
Updating and Running the Bot
-
Run the following command to deploy the slash commands, and ensure they are up to date.
node deploy-commands.js
-
Run the following command to start your bot.
node index.js
-
Your bot should now be online!
-
This discord bot works through the use of Slash Commands. All you have to do is type /
and you're ready to use your DNDiscord. You can easily see all the commands a bot has, as well as any validation and error handling that will help you get the command right the first time.
The code provided in this repository is intended for private, non-commercial use only. It is designed to be used with legally obtained digital materials. Users are responsible for ensuring they comply with all relevant copyright laws and licensing agreements, including those of Wizards of the Coast. This bot may utilize PDF scanning of copyrighted material. Use of this code to scan, distribute, or publicly display copyrighted material without permission from the copyright holder may be illegal. The author of this code is not responsible for any unlawful use.
This project is licensed under the MIT
- Discord JS
- Open5E