1.4.0 • Published 3 years ago

@tomdev/discord.js-command-handler v1.4.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

Discord.js Command Handler

Easily manage commands.

Install

npm i @tomdev/discord.js-command-handler

Usage

Main file

//discord.js libary
var discord = require("discord.js")
var client = new discord.Client({intents: [discord.Intents.FLAGS.GUILDS, discord.Intents.FLAGS.GUILD_MESSAGES]})

var handler = require("@tomdev/discord.js-command-handler")
//initialize handler, pass client, folder with command files, prefix
var prefix = "!" //same for every server
/*var prefix = { //define for each server
    "default": "!" //if server hasn't
    "6166856194426361379": "?" //prefix for server with id
    "6166856194426361380": "$" //prefix for server with id
}*/ 
var cmdhandler = new handler(client, "/commands", prefix)

//handle command on message event
client.on("messageCreated", (message) => {
    cmdhandler.handleCommand(message)
})

Command files

Example commands on Github

module.exports = {
    name: "example", //neded
    aliases: ["e", "exa"],
    category: "Main",
    description: "This is an example command",
    usage: "!example",
    run: async function (client, command, args, message) { //needed
        message.channel.send("Hello World!")
    }
}

Features and Description

Find all methods and properties on Wiki

1.4.0

3 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago