Spaces:
Runtime error
Runtime error
const { cmd, commands } = require('../command'); | |
const os = require("os"); | |
const { runtime } = require('../lib/functions'); | |
cmd({ | |
pattern: "alive", | |
alias: ["status", "runtime", "uptime"], | |
desc: "Check uptime and system status", | |
category: "main", | |
react: "π", | |
filename: __filename | |
}, | |
async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { | |
try { | |
// Generate system status message | |
const status = `βββγ *SUBZERO MD* γββββ· | |
ββββββββββββββββΒ·ΰΉ | |
ββββ’ *β³Uptime*: ${runtime(process.uptime())} | |
ββββ’ *π Ram usage*: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB / ${(os.totalmem() / 1024 / 1024).toFixed(2)}MB | |
ββββ’ *βοΈ HostName*: ${os.hostname()} | |
ββββ’ *π¨βπ» Owner*: Mr Frank | |
ββββ’ *π Version*: 1.0.3 | |
ββββββββββββββββ· | |
β°ββββββββββββββββ· | |
> Β© α΄α΄α΄‘α΄Κα΄α΄ ΚΚ sα΄Κα΄’α΄Κα΄ α΄α΄ `; | |
// Send the status message with an image | |
await conn.sendMessage(from, { | |
image: { url: `https://i.postimg.cc/yNf7rQFw/prn.jpg` }, // Image URL | |
caption: status, | |
contextInfo: { | |
mentionedJid: [m.sender], | |
forwardingScore: 999, | |
isForwarded: true, | |
forwardedNewsletterMessageInfo: { | |
newsletterJid: '120363304325601080@newsletter', | |
newsletterName: 'γ πππππππ ππ γ', | |
serverMessageId: 143 | |
} | |
} | |
}, { quoted: mek }); | |
} catch (e) { | |
console.error("Error in alive command:", e); | |
reply(`An error occurred: ${e.message}`); | |
} | |
}); |