Adjustments to the command handler
This commit is contained in:
parent
471d74b9ea
commit
eb1d352915
2 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue