A simple Discord bot template built entirely with discord.js v14 and designed to work fully with slash commands.
Node.js 18or newer- A Discord application and bot created in the Discord Developer Portal
- Download the bot template, either as a ZIP file or by using Git.
- Open
config.json. - Fill in the values in
config.jsonusing the credentials of the bot you created in the Discord Developer Portal. - Run
npm install && node app.jsto install dependencies and start the bot. - Invite the bot to your server. Before doing that, make sure all required intents are enabled.
The bot uses the following values from config.json:
{
"token": "your_bot_token",
"clientId": "your_application_client_id",
"developerId": "your_discord_user_id"
}token: Your bot tokenclientId: Your application's client IDdeveloperId: The Discord user ID allowed to use theevalcommand
- Built with a fully scalable, editable, and updatable structure
- Developed with the latest version of
discord.js - Fully supports slash commands
- Includes the core structure a Discord bot project needs
- Comes with a developer-only
evalcommand
/ping: Shows the bot latency/stats: Shows bot statistics/eval: Runs JavaScript code for the developer only
BotTemplate/
|-- app.js
|-- config.json
|-- package.json
|-- src/
| |-- commands/
| | |-- dev/
| | |-- utility/
| |-- events/
| |-- handlers/
- Create a new
.jsfile inside a command category insrc/commands/. - Export a
dataobject built withSlashCommandBuilder. - Export an
execute(client, interaction)function. - Restart the bot to load and deploy the command automatically.
- Commands are loaded automatically from the
src/commandsfolders. - Events are loaded automatically from the
src/eventsfolder. - Global slash commands can take a short while to refresh on Discord after restarting the bot.
- The
evalcommand is restricted to the user ID set indeveloperId. - Never share your real bot token publicly. If it is ever exposed, regenerate it immediately from the Discord Developer Portal.
You can join our Discord server to get help or share your suggestions.
This project is licensed under the MIT License.