A modular, scalable Discord bot template built with Discord.js v14, featuring support for both prefix and slash commands.
- ✅ Prefix Commands — Traditional
!help
style commands supported - ✅ Slash Commands — Modern
/help
style commands with full Discord interaction support - ✅ Automatic Command Loader — Auto-loads all commands from the
commands
folder dynamically - ✅ Modular Event System — Events are cleanly separated and automatically registered
- ✅ Docker Support — Ready-to-deploy using Docker
- Node.js v16.9.0 or higher
- npm or yarn
- Docker (optional)
-
Clone the repository:
git clone https://github.com/umit-ulusoy/discord-bot-boilerplate.git cd discord-bot-boilerplate
-
Install dependencies:
npm install
-
Copy the
config.example.js
file toconfig.js
and fill in the required fields:export default { TOKEN: '', // Bot's token CLIENT_ID: '', // Bot's ID GUILD_ID: '', // ID of the Discord server where slash commands will be registered PREFIX: '', // Command prefix (e.g., "!") OWNERS: { // Owner IDs UMIT: '' } }
-
Start the bot:
npm start
-
Build the Docker image:
docker build -t discord-bot .
-
Run the Docker container:
docker run -d --name discord-bot discord-bot
📦 discord-bot-boilerplate
┣ 📂 commands # Contains both slash and prefix commands
┣ 📂 events # Handles all Discord event listeners
┣ 📂 loaders # Auto-loads commands and events
┣ 📄 bot.js # Entry point of the bot
┣ 📄 Dockerfile # Docker container setup
┗ 📄 config.example.js # Example configuration file
Feel free to open issues or submit pull requests if you'd like to contribute or improve the boilerplate!
This project is licensed under the MIT License.