const fs = require("fs-extra"); const path = require("path"); const https = require("https"); module.exports = { config: { name: "help", aliases: ["menu", "commands"], version: "5.0", author: "AKASH", shortDescription: "Show all commands", longDescription: "Show all commands in fancy font with boxes", category: "system", guide: "{pn}help [command name]" }, onStart: async function({ message, args, prefix }) { const allCommands = global.GoatBot.commands; const categories = {}; // Command font (š€š€š€š€šš style) const fancyFont = (str) => str.replace(/[A-Za-z]/g, (c) => { const map = { A:"š€", B:"š", C:"š‚", D:"šƒ", E:"š„", F:"š…", G:"š†", H:"š‡", I:"šˆ", J:"š‰", K:"šŠ", L:"š‹", M:"šŒ", N:"š", O:"šŽ", P:"š", Q:"š", R:"š‘", S:"š’", T:"š“", U:"š”", V:"š•", W:"š–", X:"š—", Y:"š˜", Z:"š™", a:"šš", b:"š›", c:"šœ", d:"š", e:"šž", f:"šŸ", g:"š ", h:"š”", i:"š¢", j:"š£", k:"š¤", l:"š„", m:"š¦", n:"š§", o:"šØ", p:"š©", q:"šŖ", r:"š«", s:"š¬", t:"š­", u:"š®", v:"šÆ", w:"š°", x:"š±", y:"š²", z:"š³" }; return map[c] || c; }); // Category font (šš‚ššˆšš‚ššƒš™“š™¼ style) for ALL categories const categoryFont = (str) => str.split("").map(c => { const map = { A:"š™°", B:"š™±", C:"š™²", D:"š™³", E:"š™“", F:"š™µ", G:"š™¶", H:"š™·", I:"š™ø", J:"š™¹", K:"š™ŗ", L:"š™»", M:"š™¼", N:"š™½", O:"š™¾", P:"š™æ", Q:"šš€", R:"šš", S:"šš‚", T:"ššƒ", U:"šš„", V:"šš…", W:"šš†", X:"šš‡", Y:"ššˆ", Z:"šš‰", a:"ššŠ", b:"šš‹", c:"ššŒ", d:"šš", e:"ššŽ", f:"šš", g:"šš", h:"šš‘", i:"šš’", j:"šš“", k:"šš”", l:"šš•", m:"šš–", n:"šš—", o:"šš˜", p:"šš™", q:"ššš", r:"šš›", s:"ššœ", t:"šš", u:"ššž", v:"ššŸ", w:"šš ", x:"šš”", y:"šš¢", z:"šš£" }; return map[c] || c; }).join(""); const cleanCategoryName = (text) => text ? text.toLowerCase() : "others"; // Categorize commands for (const [name, cmd] of allCommands) { const cat = cleanCategoryName(cmd.config.category); if (!categories[cat]) categories[cat] = []; categories[cat].push(name); } // Format commands **inside the box** const formatCommandsBox = (cmds) => cmds.sort().map(c => `│ │ āŽ™ ${fancyFont(c)}`).join("\n"); // Build message let msg = `│\n│ ${fancyFont("COMMANDS MENU")}\n│ ───────────────\n`; msg += `│ ${fancyFont("PREFIX")} : ${prefix}\n`; msg += `│ ${fancyFont("TOTAL")} : ${allCommands.size}\n`; msg += `│ ${fancyFont("AUTHOR")} : äŗ—ā€¢š˜”š˜ˆš˜”š˜œš˜•āœæį­„\n│\n`; for (const cat of Object.keys(categories)) { msg += `│ ā”Œā”€ ${categoryFont(cat.toUpperCase())} ─┐\n`; msg += formatCommandsBox(categories[cat]) + "\n"; msg += `│ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜\n│\n`; } msg += `│ š”š’š„ : ${prefix}help \n│`; // GIFs array const gifURLs = [ "https://i.imgur.com/HJpCU1g.mp4", "https://i.imgur.com/RVUlRqD.mp4", "https://i.imgur.com/AnivRhA.mp4" ]; const randomGifURL = gifURLs[Math.floor(Math.random() * gifURLs.length)]; const gifFolder = path.join(__dirname, "cache"); if (!fs.existsSync(gifFolder)) fs.mkdirSync(gifFolder, { recursive: true }); const gifName = path.basename(randomGifURL); const gifPath = path.join(gifFolder, gifName); if (!fs.existsSync(gifPath)) await downloadGif(randomGifURL, gifPath); return message.reply({ body: msg, attachment: fs.createReadStream(gifPath) }); } }; // Download GIF function function downloadGif(url, dest) { return new Promise((resolve, reject) => { const file = fs.createWriteStream(dest); https.get(url, (res) => { if (res.statusCode !== 200) { fs.unlink(dest, () => {}); return reject(new Error(`Failed to download '${url}' (${res.statusCode})`)); } res.pipe(file); file.on("finish", () => file.close(resolve)); }).on("error", (err) => { fs.unlink(dest, () => {}); reject(err); }); }); }