// code from goatstore // api: https://store.agi.bd const fs = require("fs-extra"); const path = require("path"); const https = require("https"); module.exports = { config: { name: "help", aliases: ["menu", "cmds"], version: "7.0", author: "Rayhan", shortDescription: "Show all commands with new UI", longDescription: "Premium glassy help menu", category: "system", guide: "{pn}help [command name]" }, onStart: async function ({ message, args, prefix }) { const allCommands = global.GoatBot.commands; // নতুন ফন্ট স্টাইল const fancyFont = (str) => `『 ${str} 』`; const boxLine = "━━━━━━━━━━━━━━━"; const cleanCategoryName = (text) => text ? text.toLowerCase() : "others"; // যদি স্পেসিফিক কমান্ড চায় if (args[0]) { const cmdName = args[0].toLowerCase(); const cmd = allCommands.get(cmdName) || [...allCommands.values()].find(c => c.config.aliases?.includes(cmdName)); if (!cmd) return message.reply( `❌ | ${fancyFont(`Command '${cmdName}' not found`)} \n➤ Try ${prefix}help to see full list` ); const usage = typeof cmd.config.guide === "string" ? cmd.config.guide.replace("{pn}", prefix) : `${prefix}${cmd.config.name}`; const infoMsg = ` ╭━━━〔 ${fancyFont("COMMAND INFO")} 〕━━━╮ ┃ ┃ ✧ Name : ${cmd.config.name} ┃ ✧ Aliases : ${cmd.config.aliases?.join(", ") || "None"} ┃ ✧ Category : ${(cmd.config.category || "Others").toUpperCase()} ┃ ✧ Version : v${cmd.config.version || "1.0"} ┃ ✧ Author : ${cmd.config.author || "Unknown"} ┃ ✧ Usage : ${usage} ┃ ┣━━━〔 ${fancyFont("DESCRIPTION")} 〕━━━┫ ┃ ┃ ${(cmd.config.longDescription || cmd.config.shortDescription || "No description")} ┃ ╰━━━━━━━━━━━━━━━╯`; return message.reply(infoMsg); } // সব কমান্ড ক্যাটাগরি অনুযায়ী সাজানো const categories = {}; for (const [name, cmd] of allCommands) { const cat = cleanCategoryName(cmd.config.category); if (!categories[cat]) categories[cat] = []; categories[cat].push(name); } let msg = ` ╭━━━━〔 ${fancyFont("RAYHAN BOT MENU")} 〕━━━━╮ ┃ ┃ 🌸 Prefix : ${prefix} ┃ 📦 Total Cmds : ${allCommands.size} ┃ 👑 Owner : Rayhan ┃ ⚡ Version : 7.0 ┃ ┣━━━━〔 ${fancyFont("COMMAND LIST")} 〕━━━━┫ `; for (const cat of Object.keys(categories).sort()) { const catTitle = cat.toUpperCase(); msg += `\n┃ 『 ${catTitle} 』\n`; msg += `┃ ${boxLine}\n`; for (const cmdName of categories[cat].sort()) { msg += `┃ ➤ ${cmdName}\n`; } msg += `┃ ${boxLine}\n`; } msg += ` ┃ ╰━━━ Use: ${prefix}help ━━━╯`; // রেন্ডম GIF const gifURLs = [ "https://i.imgur.com/8b0X8vC.gif", "https://i.imgur.com/J5tP9Qy.gif", "https://i.imgur.com/KQBcxOV.gif" ]; 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) }); } }; 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(); } res.pipe(file); file.on("finish", () => file.close(resolve)); }).on("error", (err) => { fs.unlink(dest, () => {}); reject(err); }); }); }