mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-03 07:35:39 -05:00
v8.0.0-alpha
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class CommandContext {
|
||||
constructor(name, aliases, description, trustLevel, usages) {
|
||||
this.data = {};
|
||||
this.data.name = name;
|
||||
this.data.aliases = aliases;
|
||||
this.data.description = description;
|
||||
this.data.trustLevel = trustLevel;
|
||||
this.data.usages = usages;
|
||||
}
|
||||
}
|
||||
module.exports = CommandContext;
|
||||
@@ -0,0 +1,18 @@
|
||||
// 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
|
||||
@@ -0,0 +1,7 @@
|
||||
class CommandSource {
|
||||
constructor(player, sources) {
|
||||
this.player = player;
|
||||
this.sources = sources;
|
||||
}
|
||||
}
|
||||
module.exports = CommandSource;
|
||||
Reference in New Issue
Block a user