goat
command
website
Website Information
0
views
0
likes
0
installs
raw source
const fs = require("fs-extra");
const request = require("request");
const path = require("path");
module.exports = {
config: {
name: "website",
version: "1.0.0",
author: "Mûñtåsîr Asif",
role: 0,
shortDescription: "Website Information",
category: "information",
guide: {
en: "website"
}
},
onStart: async function ({ api, event }) {
const websiteText = `
╭─ 👑 WEBSITE INFO 👑 ─╮
│ 👤 Name : Mûñtåsîr Asif 🙂
│ 📍 From : Jossor 😫🌷
│ 🏫 Class : Mon a nai 🥲🙌🏻
│ 🎂 Age : 11 🌚💋
│ 🎉 Birthday : 15 May 🥺🎂
╰────────────────╯
🌐 WEBSITE:
https://asifevomodbd.netlify.app/
`;
const cacheDir = path.join(__dirname, "cache");
const videoPath = path.join(cacheDir, "website.mp4");
if (!fs.existsSync(cacheDir)) {
fs.mkdirSync(cacheDir, { recursive: true });
}
const videoUrl =
"https://drive.google.com/uc?export=download&id=1xzRHlnlnf_QRNkI0hnTssEAlACF0t0gc";
const sendWithoutVideo = () => {
api.sendMessage(
websiteText,
event.threadID,
event.messageID
);
};
request(encodeURI(videoUrl))
.pipe(fs.createWriteStream(videoPath))
.on("close", () => {
api.sendMessage(
{
body: websiteText,
attachment: fs.createReadStream(videoPath)
},
event.threadID,
() => {
if (fs.existsSync(videoPath)) {
fs.unlinkSync(videoPath);
}
},
event.messageID
);
})
.on("error", () => {
sendWithoutVideo();
});
}
};