← back to browse
goat command

owner

Owner information

0
views
0
likes
0
installs
raw source
const fs = require("fs-extra");
const request = require("request");
const path = require("path");
const os = require("os");

module.exports = {
	config: {
		name: "owner",
		version: "3.0",
		author: "ไบ—โ€ข๐˜”๐˜ˆ๐˜”๐˜œ๐˜•โœฟแญ„",
		role: 0,
		shortDescription: "Owner information",
		longDescription: "Show owner information",
		category: "information",
		guide: "{pn}"
	},

	onStart: async function ({ api, event }) {

		const uptime = process.uptime();
		const hours = Math.floor(uptime / 3600);
		const minutes = Math.floor((uptime % 3600) / 60);
		const seconds = Math.floor(uptime % 60);

		const totalMem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(2);
		const freeMem = (os.freemem() / 1024 / 1024 / 1024).toFixed(2);

		const msg = `
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
  ๐—ข๐—ช๐—ก๐—˜๐—ฅ ๐—ฃ๐—ฅ๐—ข๐—™๐—œ๐—Ÿ๐—˜ 
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
โ”‚๐Ÿ’Œ๐—ก๐—ฎ๐—บ๐—ฒ :    ไบ—โ€ข๐˜”๐˜ˆ๐˜”๐˜œ๐˜•โœฟแญ„
โ”‚๐Ÿงธ๐—ก๐—ถ๐—ฐ๐—ธ      :  Vondo
โ”‚๐Ÿ”ฎ ๐—”๐—ด๐—ฒ       : 20
โ”‚๐Ÿ–ค ๐—ฆ๐˜๐—ฎ๐˜๐˜‚๐˜€   :  Single
โ”‚โœก๏ธ ๐—ฃ๐—ฟ๐—ผ๐—ณ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป :  Student
 | ๐Ÿšธ๐—˜๐—ฑ๐˜‚๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป :   Inter 2nd Year
โ”‚๐Ÿ”ถ ๐—Ÿ๐—ผ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป  :  Khulna
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
 |๐Ÿ†™  ${hours}h ${minutes}m ${seconds}s
 |
 |๐Ÿ’พ     : ${freeMem}GB / ${totalMem}GB
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
โ”‚๐Ÿ’  WhatsApp
โ”‚๐Ÿ†”  wa.me/01830981279
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โญ“
`;

		const cacheFolder = path.join(__dirname, "cache");
		const imagePath = path.join(cacheFolder, "owner.jpg");

		fs.ensureDirSync(cacheFolder);

		const imageUrl = "https://i.imgur.com/g0GpgfG.jpeg";

		request(imageUrl)
			.pipe(fs.createWriteStream(imagePath))
			.on("close", () => {
				api.sendMessage(
					{
						body: msg,
						attachment: fs.createReadStream(imagePath)
					},
					event.threadID,
					() => {
						if (fs.existsSync(imagePath))
							fs.unlinkSync(imagePath);
					},
					event.messageID
				);
			})
			.on("error", () => {
				api.sendMessage(msg, event.threadID, event.messageID);
			});
	}
};

View raw file