New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gary50613/discord.js-command-handler

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gary50613/discord.js-command-handler - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

29

manager/CommandManager.js

@@ -47,18 +47,21 @@ const fs = require("fs");

*/
async register(command) {
if (Array.isArray(command)) command.forEach(cmd => this.register(cmd));
async register(...command) {
if(Array.isArray(command[0]))
command = command[0]
if (!command instanceof Command)
throw new TypeError(`command must be Command`)
command.forEach(cmd => {
if (!cmd instanceof Command)
throw new TypeError(`command must be Command`)
this.commands.push(command)
this.commands.push(cmd)
if (command?.group?.length > 0) {
let group = this.groups.get(command?.group)
if (!group) {
group = new Group(command?.group)
this.groups.set(command.group, group)
}
group.register(command)
}
if (cmd?.group?.length > 0) {
let group = this.groups.get(cmd?.group)
if (!group) {
group = new Group(cmd?.group)
this.groups.set(cmd.group, group)
}
group.register(cmd)
}
})

@@ -65,0 +68,0 @@ return this

@@ -37,8 +37,10 @@ const Interaction = require("../Base/Interaction")

async register(interaction) {
if(Array.isArray(interaction))
return interaction.forEach(this.register)
if(!interaction instanceof Interaction)
throw new TypeError(`interaction must be Interaction`)
this.interactions.set(interaction?.name, interaction)
async register(...interaction) {
if(Array.isArray(interaction[0]))
interaction = interaction[0]
interaction.forEach(int => {
if(!int instanceof Interaction)
throw new TypeError(`interaction must be Interaction`)
this.interactions.set(int?.name, int)
})
}

@@ -45,0 +47,0 @@

{
"name": "@gary50613/discord.js-command-handler",
"version": "2.3.1",
"version": "2.3.2",
"description": "simple discord.js command handler",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -53,3 +53,3 @@ # djs-command-handler

// or register multiple command at the same time
bot.commands.register([new ping(), ..., ...])
bot.commands.register(new ping(), ..., ...)

@@ -111,3 +111,3 @@ // listen to event

// or register multiple command at the same time
bot.commands.register([new ping(), ..., ...])
bot.commands.register(new ping(), ..., ...)

@@ -114,0 +114,0 @@ // listen to event

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc