// code from goatstore // api: https://store.agi.bd // ============ CLEARLINE FIX ============ if (typeof process.stderr.clearLine !== "function") { process.stderr.clearLine = () => {}; } if (typeof process.stderr.cursorTo !== "function") { process.stderr.cursorTo = () => {}; } if (typeof process.stdout.clearLine !== "function") { process.stdout.clearLine = () => {}; } if (typeof process.stdout.cursorTo !== "function") { process.stdout.cursorTo = () => {}; } // ======================================= module.exports = { config: { name: "uptime", aliases: ["up", "upt"], version: "1.3.0", author: "Mehedi-saito", countDown: 5, role: 0, shortDescription: { en: "Check bot uptime with video" }, longDescription: { en: "Shows bot uptime, server info, total users, commands and sends a video" }, category: "system", guide: { en: "{pn}" } }, onStart: async function ({ message }) { const os = require("os"); // Bot Uptime const uptime = process.uptime(); const days = Math.floor(uptime / (60 * 60 * 24)); const hours = Math.floor((uptime % (60 * 60 * 24)) / (60 * 60)); const minutes = Math.floor((uptime % (60 * 60)) / 60); const seconds = Math.floor(uptime % 60); let uptimeText = ""; if (days > 0) uptimeText += `${days}d `; if (hours > 0) uptimeText += `${hours}h `; if (minutes > 0) uptimeText += `${minutes}m `; uptimeText += `${seconds}s`; // System Info const platform = os.platform(); const arch = os.arch(); const nodeVersion = process.version; const totalMem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(2); const freeMem = (os.freemem() / 1024 / 1024 / 1024).toFixed(2); const usedMem = (totalMem - freeMem).toFixed(2); const cpuCores = os.cpus().length; // Total Users & Commands const totalUsers = global.db?.allUserData?.length || 0; const totalCmds = global.GoatBot?.commands?.size || 0; const videoUrl = "https://drive.google.com/uc?export=download&id=1tUFHtX_CpL-2jTbKDHet58vXOQlFYiK3"; const msg = `╭────「 𝗕𝗢𝗧 𝗨𝗣𝗧𝗜𝗠𝗘 」────╮ │ │ ⏱ 𝗨𝗽𝘁𝗶𝗺𝗲 : ${uptimeText} │ 🖥 𝗦𝗲𝗿𝘃𝗲𝗿 : Railway │ 💻 𝗣𝗹𝗮𝘁𝗳𝗼𝗿𝗺 : \( {platform} ( \){arch}) │ 🧠 𝗖𝗣𝗨 : ${cpuCores} Cores │ 💾 𝗠𝗲𝗺𝗼𝗿𝘆 : ${usedMem} / ${totalMem} GB │ 🟢 𝗡𝗼𝗱𝗲 : ${nodeVersion} │ 👥 𝗧𝗼𝘁𝗮𝗹 𝗨𝘀𝗲𝗿 : ${totalUsers} │ 📦 𝗧𝗼𝘁𝗮𝗹 𝗖𝗺𝗱 : ${totalCmds} │ 🔧 𝗣𝗿𝗲𝗳𝗶𝘅 : ! │ 👑 𝗔𝘂𝘁𝗵𝗼𝗿 : Mehedi-saito │ ╰─────────────────────────╯`; try { const attachment = await global.utils.getStreamFromURL(videoUrl); return message.reply({ body: msg, attachment: attachment }); } catch (err) { return message.reply(msg + `\n\n⚠️ Video load failed.`); } } };