@d3oxy/djs-commands
v1.4.10
Published
A feature rich command handler for discord.js
Downloads
53
Maintainers
Readme
DJSCommands
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.
Features
- 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
Installation
You can install DJS-Commands via npm:
npm install @d3oxy/djs-commands
Usage
You can find the full documentation here. Here's a basic example of how to use DJS-Commands in your bot:
Javascript
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");
Typescript
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");
Documentation
You can find the full documentation here.
Contributing
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.
License
DJSCommands is released under the MIT License.