DJS-Commands is a lightweight, easy-to-use command handling library for Discord.js bots. It's designed to make it easy for developers to add custom commands to their bots without having to write all the boilerplate code themselves.
- Simple command creation and management
- Supports Legacy commands and Slash commands
- Well written, easy to follow documentation
- Custom command validations
- Command aliases
- Dynamic argument validation
- Easy integration with existing Discord.js bots
- Lightweight and fast
- Event Handler
- Feature handler
You can install DJS-Commands via npm:
npm install @d3oxy/djs-commands
You can find the full documentation here. Here's a basic example of how to use DJS-Commands in your bot:
const { Client, IntentsBitField, Partials } = require("discord.js");
const path = require("path");
const CommandHandler = require("@d3oxy/djs-commands");
require("dotenv").config();
const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
IntentsBitField.Flags.GuildMembers,
],
partials: [Partials.Channel],
});
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
new CommandHandler({
client, // Required
mongoUri: process.env.MONGO_URI, // Optional
commandDir: path.join(__dirname, "commands"),
featuresDir: path.join(__dirname, "features"),
defaultPrefix: "!", // Default
events: {
dir: path.join(__dirname, "events"),
},
});
});
client.login("YOUR_BOT_TOKEN");
import { Client, IntentsBitField, Partials } from "discord.js";
import path from "path";
import CommandHandler from "@d3oxy/djs-commands";
require("dotenv").config();
const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
IntentsBitField.Flags.GuildMembers,
],
partials: [Partials.Channel],
});
client.on("ready", () => {
console.log(`Logged in as ${client.user?.tag}!`);
new CommandHandler({
client, // Required
mongoUri: process.env.MONGO_URI, // Optional
commandDir: path.join(__dirname, "commands"),
featuresDir: path.join(__dirname, "features"),
defaultPrefix: "!", // Default
events: {
dir: path.join(__dirname, "events"),
},
});
});
client.login("YOUR_BOT_TOKEN");
You can find the full documentation here.
Contributions are welcome! If you find a bug or have a feature request, please create an issue on the GitHub repository. If you'd like to contribute code, please fork the repository and submit a pull request.
DJSCommands is released under the MIT License.