Adjustments to the command handler

This commit is contained in:
7cc5c4f330d47060 2024-11-07 01:22:04 -05:00
parent 471d74b9ea
commit eb1d352915
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
2 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -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;