Skip to content

💡 Unleash the potential of your Discord.js bot with DJS-Commands, the intuitive command handling library.

License

Notifications You must be signed in to change notification settings

D3OXY/djs-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • 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.