mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 21:55:38 -05:00
17 lines
465 B
JavaScript
17 lines
465 B
JavaScript
// TODO: Improve how messages are stringified
|
|
const ChatMessage = require("prismarine-chat")("1.21.8");
|
|
const stringify = (message) => new ChatMessage(message)?.toString();
|
|
|
|
class CommandError extends Error {
|
|
constructor(message, filename, lineError) {
|
|
super(stringify(message), filename, lineError);
|
|
this.name = "CommandError";
|
|
this._message = message;
|
|
}
|
|
|
|
get message() {
|
|
return stringify(this._message);
|
|
}
|
|
}
|
|
module.exports = CommandError;
|