add command error handling

This commit is contained in:
1e99 2025-07-22 17:36:11 +02:00
parent 02c4a0a4a3
commit d4a5fcd4eb

View file

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