package-skeleton-discordjs is a template that uses the latest discord.js version to help you create a project in minutes without the hassle of creating each file individually.
- slash commands support;
- sharding support;
- uses the latest discord.js version;
- deploy slash commands easy using
npm run deploy
- deploying in minutes;
- ready for production;
Press the green button "Use this template" or click here.
After downloading your repository, you need to install the dependencies. At the root directory of your project, run the following command:
npm install
DISCORD_AUTH_TOKEN= <> (Your Discord bot token)
At the root directory of your project, run the following command:
npm start
Your bot is now running and ready to use.
DISCORD_CLIENT_ID
- This is the client id of your Discord bot. You shouldn't worry about setting it manually as we will automatically set it for you.
DISCORD_TESTING_GUILD_ID
- This is the id of the guild where guild slash commands will be registered.
Global commands are cached for one hour. New global commands will fan out slowly across all guilds and will only be guaranteed to be updated after an hour. Guild commands update instantly. As such, we recommend you use guild-based commands during development and publish them to global commands when they're ready for public use. ~ https://discordjs.guide
The npm run deploy
command will deploy the slash commands from your project to Discord. Upon running this command, it will ask you if you want to deploy the commands to the testing guild or globally.
Do you want to deploy the commands globally? If yes, type "YES", otherwise don't type anything:
If you say "YES", the commands will be deployed globally, otherwise they will be deployed to the testing guild provided in the configuration.json
file (DISCORD_TESTING_GUILD_ID
).