desc for commands
This commit is contained in:
parent
f0f914ec96
commit
3216aeac66
9 changed files with 19 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
|||
module.exports.desc = "silent commandblock";
|
||||
module.exports.usage = "<command>";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
client.utils.cmdBlock(client, args.join(" "));
|
||||
};
|
|
@ -7,6 +7,7 @@ function crashClient(client, name) {
|
|||
}
|
||||
|
||||
module.exports.desc = "crash players/the server";
|
||||
module.exports.usage = "[player]";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
if(args.length === 0) return crashServer(client);
|
||||
crashClient(client, args[0]);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const util = require("util");
|
||||
module.exports.desc = "eval code";
|
||||
module.exports.usage = "<code>";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
try {
|
||||
/*jshint ignore:start*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const util = require("util");
|
||||
module.exports.desc = "eval + silent cmdblock.";
|
||||
module.exports.usage = "<code>";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
try {
|
||||
/*jshint ignore:start*/
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
const fs = require("fs");
|
||||
const commands = fs.readdirSync("./commands");
|
||||
module.exports.desc = "get help for commands or something idk";
|
||||
module.exports.usage = "[command]";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
if(args[0] && commands.includes(`${args[0]}.js`)) {
|
||||
let cmd = require(`./${args[0]}`);
|
||||
vanillaclient.chat(`§7Help for: §6${args[0]}`)
|
||||
vanillaclient.chat(`§6${args[0]}§7: §3${cmd.desc}`);
|
||||
vanillaclient.chat(`§7Help for: §6${args[0]}`);
|
||||
let usage = cmd.usage ? " "+cmd.usage : "";
|
||||
vanillaclient.chat(`§6${args[0]}${usage}§7: §3${cmd.desc}`);
|
||||
} else if(!args[0]) {
|
||||
commands.forEach(function(command) {
|
||||
let cmd = require(`./${command}`);
|
||||
vanillaclient.chat(`§6${command.replace(".js","")}§7: §3${cmd.desc}`);
|
||||
let usage = cmd.usage ? " "+cmd.usage : "";
|
||||
vanillaclient.chat(`§6${command.replace(".js","")}${usage}§7: §3${cmd.desc}`);
|
||||
});
|
||||
} else {
|
||||
vanillaclient.chat("§4Command not found. :(");
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
const crypto = require("crypto");
|
||||
const config = require("../config.js");
|
||||
module.exports.desc = "automatically append hash for hbot commands";
|
||||
module.exports.usage = "<hbot command>";
|
||||
module.exports.exec = function(vanillaclient, client, server, args) {
|
||||
const sha256 = crypto.createHash("sha256");
|
||||
const command = args.join(" ");
|
||||
const command = `#${args.join(" ")}`;
|
||||
const time = Math.floor(+new Date() / 10000);
|
||||
let raw = command.replace(/&[0-9a-fklmnor]/g, "");
|
||||
raw += ";";
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
module.exports.desc = "lists all the players in the server";
|
||||
module.exports.usage = "[--send] [uuids]";
|
||||
module.exports.exec = function (vanillaclient, client, server, args) {
|
||||
let players = "";
|
||||
for(let player of Object.values(client.players)) {
|
||||
players += `${player.name}§r`;
|
||||
if(args[0] === "uuids") players += ` (${player.UUID})`;
|
||||
if(args.join(" ").includes("uuids")) players += ` (${player.UUID})`;
|
||||
players += ", ";
|
||||
}
|
||||
vanillaclient.chat(`There are ${Object.keys(client.players).length} players online: ${players.substr(0, players.length-2)}.`);
|
||||
let str = `There are ${Object.keys(client.players).length} players online: ${players.substr(0, players.length-2)}.`;
|
||||
if(!args.join(" ").includes("--send")) return vanillaclient.chat(str);
|
||||
client.utils.cmdBlock(client, `/bcraw ${str}`);
|
||||
};
|
|
@ -22,6 +22,7 @@ function owoifyText(v) {
|
|||
return output;
|
||||
}
|
||||
module.exports.desc = "makes your text be uwu owo nya~";
|
||||
module.exports.usage = "[--send] <text>";
|
||||
module.exports.exec = function(vanillaclient, client, server, args) {
|
||||
let owo = owoifyText(args.join(" ").replace("--send ",""));
|
||||
if(args[0] === "--send") return client.chat(owo);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module.exports.desc = "makes your text be rainbow (code from hhh, ported by me)";
|
||||
module.exports.usage = "[--send] <text>";
|
||||
module.exports.exec = function(vanillaclient, client, server, args) {
|
||||
let rainbow = client.utils.rainbowify(args.join(" ").replace("--send ",""));
|
||||
if(args[0] === "--send") return client.utils.cmdBlock(client, `/tellraw @a ${rainbow}`);
|
||||
|
|
Reference in a new issue