@archfachnad/djs-command-handler
v1.0.6
Published
a powerful djs command handler
Downloads
8
Readme
Advanced Command Handler for Discord.js
An advanced command handler for Discord.js bots, designed to streamline the process of creating, registering, and handling commands, including slash commands and message commands.
Features
- Easy to use and configure
- Supports both slash commands and message commands
- Supports event and features handling
- Automatic command registration
- Flexible command structure
- Built-in error handling
- Supports command permissions
Installation
Install the package via npm:
npm i @archfachnad/djs-command-handler
Example
const { Client, GatewayIntentBits } = require('discord.js');
const CH = require('@archfachnad/djs-command-handler');
require('dotenv/config');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
client.once("ready", (i) => { // Self explanatory
console.log(`${i.user.tag} is ready!`); // Self explanatory
new CH({
client, // This imports the client (important to have this!)
events: {
dir: path.join(process.cwd(), "src", "events"), // Directory where your event files are located
},
featuresDir: path.join(process.cwd(), "src", "features"), // Directory where your features files are located
commandsDir: path.join(process.cwd(), "src", "commands"), // Directory where your command files are located
});
});
client.login(process.env.Token_Here); // Logs into the bot with the bots token
Creating Commands
export default {
run: async ({ message }) => {
await message.reply('pong')
},
}