@gary50613/discord.js-command-handler
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -36,5 +36,5 @@ const fs = require("fs"); | ||
bot.commands.get(command)?.execute(bot, m, args, m?.member, m?.guild) | ||
.then(() => this.emit("execute", bot.commands.get(command), m)) | ||
.catch((e) => this.emit("promiseError", e, bot.commands.get(command), m)) | ||
.finally(() => bot.ratelimit?.updateRatelimit(m?.member)) | ||
.then(() => this.emit("execute", bot.commands.get(command), m)) | ||
.catch((e) => this.emit("promiseError", e, bot.commands.get(command), m)) | ||
.finally(() => bot.ratelimit?.updateRatelimit(m?.member)) | ||
} catch (e) { | ||
@@ -41,0 +41,0 @@ this.emit("error", e, bot.commands.get(command), m) |
@@ -24,4 +24,10 @@ const Interaction = require("../Base/Interaction") | ||
if(executor) { | ||
let handler = new InteractionHandler(bot, interaction) | ||
executor.execute(bot, handler, interaction?.data?.options, interaction?.member) | ||
try { | ||
let handler = new InteractionHandler(bot, interaction) | ||
executor.execute(bot, handler, interaction?.data?.options, interaction?.member) | ||
.then(() => this.emit("execute", executor, handler)) | ||
.catch((e) => this.emit("promiseError", e, executor, handler)) | ||
} catch(e) { | ||
this.emit("error", e, executor, handler) | ||
} | ||
} | ||
@@ -28,0 +34,0 @@ }) |
{ | ||
"name": "@gary50613/discord.js-command-handler", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "simple discord.js command handler", | ||
"main": "CommandHandler.js", | ||
"main": "index.js", | ||
"directories": { | ||
@@ -22,3 +22,5 @@ "doc": "doc", | ||
"ratelimit", | ||
"handler" | ||
"handler", | ||
"interaction", | ||
"slash" | ||
], | ||
@@ -25,0 +27,0 @@ "author": "Gary50613", |
17767
346