A powerful and flexible command handler for Discord.js v14 with automatic command reloading, database support, and advanced error handling.
- 🔄 Automatic command reloading (15s intervals)
- 📊 Command & Event monitoring with CLI tables
- 🗄️ MongoDB database support (optional)
- ⚡ Advanced error handling
- 🔒 Permission system
- ⏲️ Cooldown system
- 📁 Organized folder structure
git clone https://github.com/caedencode/caeden-djs-v14-handler.git
cd caeden-djs-v14-handler
npm install
Rename config.example.json to config.json:
{
"bot": {
"DISCORD_TOKEN": "",
"APP_ID": "",
"APP_SECRET": ""
},
"database": {
"DB_MODE": false,
"MONGO_URI": "mongodb://username:password@host:port/database"
}
}
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
cooldown: 3,
permissions: ['SendMessages'],
async execute(interaction) {
await interaction.reply('Pong!');
}
};
const { Events } = require('discord.js');
module.exports = {
name: Events.MessageCreate,
once: false,
async execute(message) {
if (message.content === 'hello') {
message.reply('Hi there!');
}
}
};
-
- Clone repository.
-
- Install dependencies.
-
- Configure config.json.
-
- Run the bot.
npm start