Upload files to "commands"

This commit is contained in:
m_c_player 2024-11-05 21:03:35 -05:00
parent 8dfd481358
commit e612ff620a
3 changed files with 52 additions and 0 deletions

14
commands/refill.js Normal file
View file

@ -0,0 +1,14 @@
const desc = "refills the core";
const usages = " - refill";
const trustLevel = 0;
function inject (client) {
const command = (() => {
client.cmdCore.refillCmdCore();
client.bcraw("Refilled core.");
})
client.runCommand = command;
return command;
}
module.exports = { inject, desc, usages, trustLevel };

22
commands/servereval.js Normal file
View file

@ -0,0 +1,22 @@
const desc = "eval code";
const usages = " - servereval <code>";
const trustLevel = 2;
const { inspect } = require("util");
function inject (client) {
const command = ((args) => {
if (args.slice(1).join(" ")) {
try {
client.tellraw("@a", { text: inspect(eval(args.slice(1).join(" "))) });
} catch (err) {
client.tellraw("@a", { text: err.toString(), color: "red" });
}
} else {
client.cmdError("Expected code");
}
})
client.runCommand = command;
return command;
}
module.exports = { inject, desc, usages, trustLevel };

16
commands/whoami.js Normal file
View file

@ -0,0 +1,16 @@
const desc = "displays your username and uuid";
const usages = " - whoami";
const trustLevel = 0;
const config = require("../config.json");
const ChatMessage = require("prismarine-chat")(config.version);
function inject (client, packet) {
const command = (() => {
client.bcraw(`${config.publicColor}Username: ${new ChatMessage(JSON.parse(packet.senderName)).toMotd().replaceAll("§", "&").replaceAll("&r", "&f")}\n${config.publicColor}UUID: ${config.trustedColor}${packet.sender}`);
})
client.runCommand = command;
return command;
}
module.exports = { inject, desc, usages, trustLevel };