A simple Discord.js message command/slash command and apps handler template. I created this project to simplify the process of creating new bots and avoid writing the same code again.
Some of the main focuses of this template are command/event handlers and app handlers. Command handlers also include permissions, aliases, and autocomplete functionality.
- You'll need NodeJS (16.11+). And a package manager for node. (npm, pnpm or yarn)
- To get started with this project clone this repository to a folder and execute the following commands to that folder.
npm install
# or
pnpm install
# or
yarn install
-
Once all dependencies are installed, rename
.env_copy
to.env
and enter environment valuesCLIENT_ID
,TOKEN
andTEST_GUILD
in this file. If you leaveTEST_GUILD
empty, the bot will register slash commands to all servers. -
Your application needs the following intents to be allowed
PRESENCE
,MESSAGE
andGUILD MEMBER
. You can enable them in your Discord Developer Dashboard or disable the intents you don't need fromindex.js
file. Privileged intents are are marked with comments.
After finishing the cofiguration run -
npm start
# or
node index.js
If everything is done correctly, your terminal should look like this -
If you happen to spot any problem or errors in this project, please create a pull request or contact me through my Discord, which is towsif.kafi. I'm always open to receiving direct messages and would be more than happy to help you out in any way possible.