DiscordJS V14 Bot Template - Introduction:
A Discord bot project made with the npm package discord.js version 14 and it handles Prefix and Slash commands. You can create many commands as you want to improve your Bot! Project made with
How to setup:
• 1- Choose a good IDE to start working on your Bot (Recommended for Hosting 24/7: Replit), and then Download/fork this project.
• 2- Create a new application at Discord Developer Portal and choose your application name.
• 3- Go to Bot
section, and then make your application into a Bot.
• 4- After doing this, click on Reset token
and then copy your Bot token. (Do not share your bot token!)
• 5- We go now into two categories: Replit users & VSCode (Visual Studio Code) users.
•• If you are using Replit, use Environment Secret Variables
. (Located in your left of your screen with a Lock icon). The key is TOKEN
and the value is going to be your bot token. And then, click on Add new secret
.
•• If you are using VSCode, use config.json
file. The value of the variable TOKEN
is going to be your bot token. Make sure that you're not streaming or recording a video to public so users will not steal your bot token!
• 6- Go to shell of your IDE and then type npm init -y
to setup the package-lock.json
file. (The goal of package-lock. json file is to keep track of the exact version of every package that is installed so that a product is 100% reproducible in the same way even if packages are updated by their maintainers.)
• 7- Type in shell npm install
or npm i
to install all required packages for your project. (If you want a clean install, use: npm ci
)
• 8- Go to shell or terminal and type node index.js
or node .
to start your Bot. (If you are using Replit, Click on the Green button ► Run
to start your bot)
• 9- Ready! Enjoy :)
What is MongoDB?
MongoDB is a database program, saves your data into a cluster from a Mongo URI. More info is linked here.
Something doesn't work here...
There are a lot of issues happens with some users. If you tried to search for a solution and didn't found it, you can send me a Friend Request on Discord using this name and tag: T.F.A#7524
Credits are required?
Well, if you are forking this project and then sharing it again is UNACCEPTABLE. But, giving credits in commands such as ?help, ?commands... etc is NOT required and you can give credits in any commands if you want, only REQUIRED in README.md.