An easy-to-use Discord bot template made using the discord.js library. This template brings you an awesome command handler with options defining how you'd like your command to run.
Setting up this template is extremely simple, so that you can focus on what matters when making a bot.
The template comes with MongoDB support, so if you wish to use a different database, or use no database at all, remove mongoose from the dependencies array in the package.json file, line 2 in the index.js file, lines 11-15 in the same file, and lines 3-5 in config-example.js.
Next, you'll need to edit the config file.
The first change is the name, which you need to change from config-example
to config
.
After that, update the values of variables to the correct information.
If you'd like to store the bot token and MongoDB connection URI inside of a .env
file, create the file in src/ and add the following at the top of the index.js file: require('dotenv').config({ path: `${process.cwd()}/src/.env`});
. Make sure to install dotenv through npm i -D dotenv
!
Once you've updated everything you need to, you're ready to run the bot!
To check for any errors before you start working on your bot, run npm start
in the console.
If there are no errors, congratulations! You've just created a brand new bot!
If you have found errors, please look at the contribution section below.
If you came across an error with the template, or have any ideas you'd like to see, feel free to open an issue.