From eb1d352915dddf470f662053cfac8afa9dcb0b30 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Thu, 7 Nov 2024 01:22:04 -0500 Subject: [PATCH] Adjustments to the command handler --- plugins/command.js | 5 ++++- util/Command.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/command.js b/plugins/command.js index 629164e..cab4d45 100644 --- a/plugins/command.js +++ b/plugins/command.js @@ -12,7 +12,10 @@ export default function load (b) { } }) b.runCommand = function (user, nick, uuid, command, type, subtype, prefix){ - const context = new Command(uuid, user, nick, command, "minecraft", type, subtype, prefix, b, 0, {}) + const context = new Command(uuid, user, nick, command, "minecraft", type, subtype, prefix, b, 0) + + b.emit('command', context) + if(cmds[context.cmdName.toLowerCase()]){ try { cmds[context.cmdName.toLowerCase()].execute(context) diff --git a/util/Command.js b/util/Command.js index e5d6c87..95db451 100644 --- a/util/Command.js +++ b/util/Command.js @@ -1,6 +1,6 @@ import { default as settings } from '../settings.json' with {type: "json"} export default class Command { - constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify, prefs) { + constructor (uuid, user, nick, cmd, senderType, msgType, msgSubtype, prefix, bot, verify) { this.uuid=uuid; this.reply = text => bot.tellraw(uuid, text) this.username = user;