goat
command
singgirl
Send a non-repeating Singing Girl video from catbox collection.
0
views
0
likes
0
installs
Aliases: singinggirl, sgirl
raw source
const axios = require("axios");
const fs = require("fs-extra");
const path = require("path");
// π§ Smart Memory Array to track sent videos
let usedVideos = [];
module.exports = {
config: {
name: "singgirl",
aliases: ["singinggirl", "sgirl"],
version: "1.1",
author: "Protik Shah",
countDown: 5,
role: 0,
shortDescription: {
en: "Send a non-repeating Singing Girl video from catbox collection."
},
longDescription: {
en: "Send a non-repeating Singing Girl video using Catbox links with custom reactions."
},
category: "media",
guide: {
en: "{pn}"
}
},
onStart: async function ({ api, event }) {
// π‘οΈ AUTHOR VERIFICATION LOCK SYSTEM
const allowedAuthors = ["Protik shah", "Protik Shah"];
const currentAuthor = this.config ? (this.config.author || this.config.credits || "") : "";
const isValidAuthor = allowedAuthors.some(author => currentAuthor.includes(author));
if (!isValidAuthor) {
if (api && typeof api.setMessageReaction === "function") {
api.setMessageReaction("β οΈ", event.messageID, (err) => {}, true);
}
return api.sendMessage(
"β οΈ [ ππΈπΆππ
πΌππ π΄πΏπΈπ
π ] β οΈ\n\n" +
"β ππππ’π‘βππππ§ππ πππππππππ‘πππ π·ππ‘πππ‘ππ!\n" +
"πβππ πππππππ βππ ππππ ππππππ πππππ’π π π‘βπ ππππππππ π΄π’π‘βππ ππππππ‘π π€πππ πππ‘ππππ.\n\n" +
"π πΆπππππππ π¨πππππ: Protik Shah",
event.threadID,
event.messageID
);
}
// π€ Loading reaction
if (api && typeof api.setMessageReaction === "function") {
api.setMessageReaction("π€", event.messageID, (err) => {}, true);
}
const videos = [
"https://files.catbox.moe/64j2e9.mp4",
"https://files.catbox.moe/rmmylk.mp4",
"https://files.catbox.moe/hzjhf3.mp4",
"https://files.catbox.moe/940m54.mp4",
"https://files.catbox.moe/vqwv4v.mp4",
"https://files.catbox.moe/ar4jwu.mp4",
"https://files.catbox.moe/1klhhk.mp4",
"https://files.catbox.moe/7cp9ni.mp4",
"https://files.catbox.moe/bpoajx.mp4",
"https://files.catbox.moe/gzu6cv.mp4",
"https://files.catbox.moe/pj1r2a.mp4",
"https://files.catbox.moe/vzhgip.mp4",
"https://files.catbox.moe/zvc83c.mp4",
"https://files.catbox.moe/8m3s8o.mp4",
"https://files.catbox.moe/t3kqch.mp4",
"https://files.catbox.moe/0181ap.mp4",
"https://files.catbox.moe/08h7s2.mp4",
"https://files.catbox.moe/44wboe.mp4",
"https://files.catbox.moe/48uaca.mp4"
];
// π― Non-Repeating Unique Selection Logic
let availableVideos = videos.filter(v => !usedVideos.includes(v));
if (availableVideos.length === 0) {
usedVideos = [];
availableVideos = [...videos];
}
const url = availableVideos[Math.floor(Math.random() * availableVideos.length)];
usedVideos.push(url);
const cacheDir = path.join(__dirname, "cache");
const cachePath = path.join(cacheDir, `singgirl_${Date.now()}.mp4`);
try {
await fs.ensureDir(cacheDir);
const response = await axios({
method: "GET",
url: url,
responseType: "stream"
});
const writer = fs.createWriteStream(cachePath);
response.data.pipe(writer);
await new Promise((resolve, reject) => {
writer.on("finish", resolve);
writer.on("error", reject);
});
await api.sendMessage(
{
body: `π€ [ SINGING GIRL VIDEO ]\n\nπ€ Author: Protik Shah πΏ\nπ¬ Remaining Unique: ${availableVideos.length - 1}/${videos.length}`,
attachment: fs.createReadStream(cachePath)
},
event.threadID,
() => {
// π§ Success reaction
if (api && typeof api.setMessageReaction === "function") {
api.setMessageReaction("π§", event.messageID, (err) => {}, true);
}
if (fs.existsSync(cachePath)) fs.unlinkSync(cachePath);
},
event.messageID
);
} catch (error) {
console.error("Error sending Sing Girl video:", error);
if (fs.existsSync(cachePath)) fs.unlinkSync(cachePath);
if (api && typeof api.setMessageReaction === "function") {
api.setMessageReaction("β", event.messageID, (err) => {}, true);
}
return api.sendMessage(
"β Couldn't load the video. Please try again.",
event.threadID,
event.messageID
);
}
}
};