mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-01 06:35:41 -05:00
18 lines
554 B
JavaScript
18 lines
554 B
JavaScript
// TODO: Improve how messages are stringified
|
|||
|
|
const ChatMessage = require("prismarine-chat")("1.20.2");
|
||
|
|
const stringify = (message) => new ChatMessage(message)?.toString();
|
||
|
|
|
||
|
|
class CommandError extends Error {
|
||
|
|
constructor(message, filename, lineError, useChat) {
|
||
|
|
super(stringify(message), filename, lineError, useChat);
|
||
|
|
this.name = "CommandError";
|
||
|
|
this._message = message;
|
||
|
|
return (this._useChat = useChat);
|
||
|
|
// this._useChat = useChat
|
||
|
|
}
|
||
|
|
|
||
|
|
get message() {
|
||
|
|
return stringify(this._message);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
module.exports = CommandError
|