add command error handling
This commit is contained in:
parent
02c4a0a4a3
commit
d4a5fcd4eb
1 changed files with 8 additions and 2 deletions
|
@ -35,8 +35,14 @@ export default class Commands {
|
|||
continue
|
||||
}
|
||||
|
||||
args.shift() // Remove command argument itself
|
||||
command.run(username, args)
|
||||
args.shift() // Remove command "argument" itself
|
||||
|
||||
try {
|
||||
command.run(username, args)
|
||||
} catch (e) {
|
||||
this.#chat.chat("Failed to execute command")
|
||||
console.error(e)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue