Upload files to "commands"
This commit is contained in:
parent
8dfd481358
commit
e612ff620a
3 changed files with 52 additions and 0 deletions
commands
14
commands/refill.js
Normal file
14
commands/refill.js
Normal 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
22
commands/servereval.js
Normal 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
16
commands/whoami.js
Normal 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 };
|
Loading…
Add table
Reference in a new issue