node-brigadier-commands/lib/exceptions/DynamicCommandExceptionType.js
Chipmunk 1d7d923001 Refactor exceptions
and maybe other things lol
2023-08-30 12:43:05 -04:00

17 lines
454 B
JavaScript

const CommandSyntaxException = require('./CommandSyntaxException.js')
class DynamicCommandExceptionType {
constructor (_function) {
this.function = _function
}
create (...args) {
return new CommandSyntaxException(this, this.function(...args))
}
createWithContext (reader, ...args) {
return new CommandSyntaxException(this, this.function(...args), reader.string, reader.cursor)
}
}
module.exports = DynamicCommandExceptionType