alt Discord

alt GitHub Repo

alt DJSCommands

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 (opens in a new tab)
  • 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 (opens in a new tab). Here's a basic example of how to use DJS-Commands in your bot:

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 (opens in a new tab).

Contributing

Contributions are welcome! If you find a bug or have a feature request, please create an issue on the GitHub repository (opens in a new tab). If you'd like to contribute code, please fork the repository and submit a pull request.

License

DJSCommands is released under the MIT License (opens in a new tab).


Thank you for considering using DJSCommands in your Discord.js bot! We hope this package simplifies the process of handling commands and enhances your bot-building experience. If you have any questions or need assistance, feel free to join our Discord community via the provided link above. Happy coding!