Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@gary50613/discord.js-command-handler
Advanced tools
Simple command handler for discord.js
run this in your terminal
npm i @gary50613/discord.js-command-handler
npm i
npm test
basic how to initialize with options
const CommandHandler = require('@gary50613/djs-command-handler')
const Discord = require('discord.js')
// import a command
const ping = require("./commands/ping")
const bot = new Discord.Client()
const commandHandler = new CommandHandler(bot, {
prefix: "."
// options
})
// register a command
commandHandler.commands.register(ping)
// or register multiple command at the same time
commandHandler.commands.register([ping, ..., ...])
// listen to event
commandHandler.on("dm", (m) => {
m.channel.send("u can only use command in a guild!")
})
bot.login(process.env.TOKEN)
make a command
const Command = require("@gary50613/djs-command-handler").Command
class Ping extends Command {
constructor() {
super(
"ping", // name
"ping the bot", // description
".ping", // usage
"general", // group
["pong"] // alias
);
}
// execute function to call
execute(bot, message, args, member, guild) {
// just write like normal discord.js
message.reply('pong!')
}
}
module.exports = Ping
type | description | parameter |
---|---|---|
dm | user execute a command in dm | Message |
ratelimit | user get ratelimited | Millisecond, Message |
execute | command successfully executed | Command, Message |
error | command execute error | Error, Command, Message |
promiseError | promise rejection | Error, Command, Message |
{
ratelimit: {
enable: false, // whether enable ratelimit
interval: 5000, // interval to limit
bypass: {
users: [], // specific users ID can bypass ratelimit
permissions: ["ADMINISTRATOR"], // specific perimissions FLAG can bypass ratelimit
roles: [] // // specific roles ID can bypass ratelimit
}
},
prefix: "PREFIX", // bot's prefix
dm: false, // whether accept dm commands
bot: false // whether accept bot execute command
}
🧑💻 Kane
Feel free to open issue or join my discord server
FAQs
simple discord.js v13 command handler
The npm package @gary50613/discord.js-command-handler receives a total of 31 weekly downloads. As such, @gary50613/discord.js-command-handler popularity was classified as not popular.
We found that @gary50613/discord.js-command-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.