From 4891feaa8db95be82a014991f5eb4922a27ba6fe Mon Sep 17 00:00:00 2001 From: ChingChang9 Date: Tue, 23 Feb 2021 11:18:47 -0500 Subject: [PATCH 1/2] Emit `disabledCommandRun` when running a disabled command --- src/dispatcher.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dispatcher.js b/src/dispatcher.js index 53d60f405..077e18f24 100644 --- a/src/dispatcher.js +++ b/src/dispatcher.js @@ -130,6 +130,7 @@ class CommandDispatcher { if(cmdMsg.command) { if(!cmdMsg.command.isEnabledIn(message.guild)) { if(!cmdMsg.command.unknown) { + this.client.emit('disabledCommandRun'); responses = await cmdMsg.reply(`The \`${cmdMsg.command.name}\` command is disabled.`); } else { /** From 6c0f8cf02098bc2cb4d01da4d35953ddfc0f74a0 Mon Sep 17 00:00:00 2001 From: ChingChang9 Date: Tue, 23 Feb 2021 11:44:54 -0500 Subject: [PATCH 2/2] Included the source message in the event --- src/dispatcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dispatcher.js b/src/dispatcher.js index 077e18f24..79e3101fa 100644 --- a/src/dispatcher.js +++ b/src/dispatcher.js @@ -130,7 +130,7 @@ class CommandDispatcher { if(cmdMsg.command) { if(!cmdMsg.command.isEnabledIn(message.guild)) { if(!cmdMsg.command.unknown) { - this.client.emit('disabledCommandRun'); + this.client.emit('disabledCommandRun', cmdMsg); responses = await cmdMsg.reply(`The \`${cmdMsg.command.name}\` command is disabled.`); } else { /**