const fs = require("fs-extra"); const path = require("path"); const https = require("https"); module.exports = { config: { role: 0, // auto-added: was missing name: "help", aliases: ["menu"], version: "12.0", author: "HR ID OY", shortDescription: "Animated Help Menu With Category Filter", category: "System", guide: "{pn}help [command | all]" }, onStart: async function ({ message, args, prefix, api }) { const commandsMap = global.GoatBot.commands; const categories = {}; const commands = []; // ===== CATEGORY WHITELIST + ICONS ===== const categoryIcons = { "Admin": "โšœ๏ธ", "AI": "๐Ÿง ", "Group": "๐Ÿ‘ฅ", "Image": "๐Ÿ–ผ๏ธ", "Game": "๐ŸŽฎ", "Love": "๐Ÿ’—", "Tag Fun": "๐Ÿท๏ธ", "NSFW": "๐Ÿ”ž", "Media": "๐ŸŽฌ", "System": "โš™๏ธ", "Utility": "๐Ÿ› ๏ธ", "Others": "๐Ÿ“ฆ" }; // เฆเฆ‡ เฆ•เงเฆฏเฆพเฆŸเฆพเฆ—เฆฐเฆฟเฆ—เงเฆฒเง‹ "help" (all เฆ›เฆพเฆกเฆผเฆพ) เฆฆเฆฟเฆฒเง‡ เฆฆเง‡เฆ–เฆพเฆฌเง‡ const allowedCategories = [ "AI", "Group", "Image", "Game", "Love", "Tag Fun", "Media" ]; const showAll = args[0] && args[0].toLowerCase() === "all"; // ===== SINGLE COMMAND INFO ===== if (args[0] && !showAll) { const cmd = commandsMap.get(args[0].toLowerCase()); if (!cmd) return message.reply("โŒ | Command not found! Try: " + prefix + "help all"); return message.reply( `ๅฝก ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—œ๐—ก๐—™๐—ข ๅฝก ๐Ÿ“Œ ๐—ก๐—ฎ๐—บ๐—ฒ : ${cmd.config.name} ๐Ÿ—‚๏ธ ๐—–๐—ฎ๐˜๐—ฒ๐—ด๐—ผ๐—ฟ๐˜† : ${categoryIcons[cmd.config.category] || "๐Ÿ“ฆ"} ${cmd.config.category} ๐Ÿ“ ๐——๐—ฒ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐—ถ๐—ผ๐—ป : ${cmd.config.shortDescription || "N/A"} ๐Ÿ’ก ๐—จ๐˜€๐—ฎ๐—ด๐—ฒ : ${prefix}${cmd.config.name} ๐Ÿ”– ๐—”๐—น๐—ถ๐—ฎ๐˜€๐—ฒ๐˜€ : ${cmd.config.aliases ? cmd.config.aliases.join(", ") : "None"}` ); } // ===== BUILD CATEGORY SYSTEM ===== for (let [name, cmd] of commandsMap) { const cat = cmd.config.category || "Others"; // showAll เฆจเฆพ เฆนเฆฒเง‡ เฆถเงเฆงเง allowedCategories เฆเฆฐ เฆ•เฆฎเฆพเฆจเงเฆก เฆจเง‡เฆฌเง‡ if (!showAll && !allowedCategories.includes(cat)) continue; if (!categories[cat]) categories[cat] = []; categories[cat].push(name); commands.push(name); } for (let cat in categories) categories[cat].sort(); // ===== LOADING ANIMATION (PROGRESS BAR) ===== const loadingFrames = [ "โณ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚...\nโ–ฐโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ 10%", "โณ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚...\nโ–ฐโ–ฐโ–ฐโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ 30%", "โณ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚...\nโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ 50%", "โณ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚...\nโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฑโ–ฑโ–ฑ 70%", "โณ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚...\nโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฑ 90%", "โœ… ๐—›๐—ฒ๐—น๐—ฝ ๐— ๐—ฒ๐—ป๐˜‚ ๐—ฅ๐—ฒ๐—ฎ๐—ฑ๐˜†!\nโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐ 100%" ]; let loadingMsg; try { loadingMsg = await message.reply(loadingFrames[0]); } catch (e) { console.error("Failed to send loading message"); } // Animate loading for (let i = 1; i < loadingFrames.length; i++) { await new Promise(res => setTimeout(res, 400)); if (loadingMsg) { try { await api.editMessage(loadingFrames[i], loadingMsg.messageID); } catch (e) { // Ignore if message is too old or deleted } } } // ===== DHAKA, BANGLADESH TIME ===== const now = new Date(); const dateStr = now.toLocaleDateString("en-US", { day: "numeric", month: "short", year: "numeric", timeZone: "Asia/Dhaka" }); const timeStr = now.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: true, timeZone: "Asia/Dhaka" }); // ===== UPTIME ===== const uptimeSeconds = process.uptime(); const upDays = Math.floor(uptimeSeconds / 86400); const upHours = Math.floor((uptimeSeconds % 86400) / 3600); const upMinutes = Math.floor((uptimeSeconds % 3600) / 60); const upSeconds = Math.floor(uptimeSeconds % 60); const uptimeStr = `${upDays}d ${upHours}h ${upMinutes}m ${upSeconds}s`; let msg = `ๅฝก ๐—ง๐—ข๐—ฅ๐—จ ๐—›๐—˜๐—Ÿ๐—ฃ ๐—ฃ๐—”๐—ก๐—˜๐—Ÿ ๅฝก\n\n`; msg += ` ๐Ÿ“ฆ ๐—ง๐—ผ๐˜๐—ฎ๐—น ๐—–๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ : ${commands.length}\n`; msg += ` ๐Ÿ”‘ ๐—•๐—ผ๐˜ ๐—ฃ๐—ฟ๐—ฒ๐—ณ๐—ถ๐˜… : ใ€Ž ${prefix} ใ€\n`; msg += ` ๐ŸŸข ๐—ฆ๐˜๐—ฎ๐˜๐˜‚๐˜€ : Active\n`; msg += ` ๐Ÿ“… ๐——๐—ฎ๐˜๐—ฒ : ${dateStr}\n`; msg += ` ๐Ÿ•’ ๐—ง๐—ถ๐—บ๐—ฒ (๐—•๐——) : ${timeStr}\n`; msg += ` โฑ๏ธ ๐—จ๐—ฝ๐˜๐—ถ๐—บ๐—ฒ : ${uptimeStr}\n\n`; msg += ` โ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌ\n\n`; for (let [cat, cmds] of Object.entries(categories)) { const icon = categoryIcons[cat] || "๐Ÿ“ฆ"; msg += `โ”Œโ”€ใ€Œ ${icon} ${cat.toUpperCase()} ใ€\n`; for (let i = 0; i < cmds.length; i += 2) { const left = cmds[i]; const right = cmds[i + 1]; msg += right ? `โ”‚ โœง ${left} โœง ${right}\n` : `โ”‚ โœง ${left}\n`; } msg += `โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n\n`; } msg += `ๅฝก ๐—•๐—ข๐—ง ๐—œ๐—ก๐—™๐—ข ๅฝก\n\n`; msg += ` ๐Ÿ‘ค ๐—”๐—ฑ๐—บ๐—ถ๐—ป : HR ID OY\n`; msg += ` ๐Ÿ“ฉ ๐—ฅ๐—ฒ๐—ฝ๐—ผ๐—ฟ๐˜ : ${prefix}callad (yourmsg)\n`; msg += ` โ„น๏ธ ๐—–๐—บ๐—ฑ ๐—œ๐—ป๐—ณ๐—ผ : ${prefix}help \n`; msg += ` โšก ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ๐—ฒ๐—ฑ ๐—•๐˜† : HRIDOY`; // ===== RANDOM GIF ===== const gifURLs = [ "https://i.imgur.com/zex8uo7.gif", "https://i.imgur.com/4ki8eBI.gif", "https://i.imgur.com/AMKQCJc.gif", "https://i.imgur.com/rkjO7YV.gif", "https://i.imgur.com/SgNPn8E.gif", "https://i.imgur.com/u3qB5y2.gif", "https://i.imgur.com/KUFxWlF.gif", "https://i.imgur.com/FV9krHV.gif", "https://i.imgur.com/lFrFMEn.gif", "https://i.imgur.com/KrEez4A.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)) { try { await downloadGif(randomGifURL, gifPath); } catch (err) { console.error("Failed to download GIF:", err); } } // Remove loading message if (loadingMsg) { try { await api.unsendMessage(loadingMsg.messageID); } catch (e) {} } // Send final help message const sent = await message.reply({ body: msg, attachment: fs.existsSync(gifPath) ? fs.createReadStream(gifPath) : null }); // ===== AUTO DELETE AFTER 1 MINUTE ===== setTimeout(() => { try { api.unsendMessage(sent.messageID); } catch (e) {} }, 60000); } }; // ===== DOWNLOAD FUNCTION ===== function downloadGif(url, dest) { return new Promise((resolve, reject) => { const file = fs.createWriteStream(dest); https.get(url, response => { response.pipe(file); file.on("finish", () => { file.close(resolve); }); }).on("error", err => { fs.unlink(dest, () => {}); reject(err); }); }); }