Added homebrew and emote, added command params to help and a help webpage generator, updated packages/readme
This commit is contained in:
parent
3d225f6547
commit
b6a2dd275a
44 changed files with 783 additions and 97 deletions
|
@ -12,7 +12,8 @@ exports.load = async (command) => {
|
|||
collections.info.set(command.split(".")[0], {
|
||||
category: props.category,
|
||||
description: props.help,
|
||||
aliases: props.aliases
|
||||
aliases: props.aliases,
|
||||
params: props.params
|
||||
});
|
||||
if (props.aliases) {
|
||||
props.aliases.forEach(alias => {
|
||||
|
|
37
utils/help.js
Normal file
37
utils/help.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
const pug = require("pug");
|
||||
const collections = require("./collections.js");
|
||||
const fs = require("fs");
|
||||
|
||||
module.exports = async () => {
|
||||
//const compiledFunction = pug.compileFile("./assets/pages/help.pug");
|
||||
const commands = Array.from(collections.commands.keys());
|
||||
const categories = {
|
||||
general: [],
|
||||
moderation: [],
|
||||
tags: [],
|
||||
fun: [],
|
||||
images: [],
|
||||
soundboard: []
|
||||
};
|
||||
for (const command of commands) {
|
||||
const category = collections.info.get(command).category;
|
||||
const description = collections.info.get(command).description;
|
||||
const params = collections.info.get(command).params;
|
||||
if (category === 1) {
|
||||
categories.general.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
} else if (category === 2) {
|
||||
categories.moderation.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
} else if (category === 3) {
|
||||
categories.tags.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
} else if (category === 4) {
|
||||
categories.fun.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
} else if (category === 5) {
|
||||
categories.images.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
} else if (category === 6) {
|
||||
categories.soundboard.push(`<strong>${command}</strong>${params ? ` ${params}` : ""} - ${description}`);
|
||||
}
|
||||
}
|
||||
fs.writeFile("../help.html", pug.renderFile("./assets/pages/help.pug", { commands: categories }), () => {
|
||||
console.log("hi");
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue