goat
command
redgirl
Send a non-repeating Red Girl video from catbox collection.
0
views
0
likes
0
installs
Aliases: redgirlvideo, rgirl
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: "redgirl",
aliases: ["redgirlvideo", "rgirl"],
version: "1.1",
author: "Protik shah",
countDown: 5,
role: 0,
shortDescription: {
en: "Send a non-repeating Red Girl video from catbox collection."
},
longDescription: {
en: "Send a random non-repeating Red 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/xktox6.mp4",
"https://files.catbox.moe/rw1vxd.mp4",
"https://files.catbox.moe/8r5z4r.mp4",
"https://files.catbox.moe/2otopk.mp4",
"https://files.catbox.moe/sg6ag6.mp4",
"https://files.catbox.moe/2n69yc.mp4",
"https://files.catbox.moe/tqx4i3.mp4",
"https://files.catbox.moe/u6ppwr.mp4",
"https://files.catbox.moe/6picwc.mp4",
"https://files.catbox.moe/fjp6eh.mp4",
"https://files.catbox.moe/tt12v3.mp4",
"https://files.catbox.moe/qjb65x.mp4",
"https://files.catbox.moe/lgg303.mp4",
"https://files.catbox.moe/2l5de7.mp4",
"https://files.catbox.moe/1itbo4.mp4",
"https://files.catbox.moe/b2e4co.mp4",
"https://files.catbox.moe/784po9.mp4",
"https://files.catbox.moe/uthj7a.mp4",
"https://files.catbox.moe/qf3epm.mp4",
"https://files.catbox.moe/bzex44.mp4",
"https://files.catbox.moe/z0pq75.mp4",
"https://files.catbox.moe/kg8lht.mp4",
"https://files.catbox.moe/fbgztj.mp4",
"https://files.catbox.moe/81s5ll.mp4",
"https://files.catbox.moe/pcefyb.mp4",
"https://files.catbox.moe/g87uij.mp4",
"https://files.catbox.moe/t0m4fd.mp4",
"https://files.catbox.moe/psnyvf.mp4",
"https://files.catbox.moe/y9581k.mp4",
"https://files.catbox.moe/50v589.mp4",
"https://files.catbox.moe/r1f7r2.mp4",
"https://files.catbox.moe/vbkw1k.mp4",
"https://files.catbox.moe/tc0jzj.mp4",
"https://files.catbox.moe/yajxkr.mp4",
"https://files.catbox.moe/856809.mp4",
"https://files.catbox.moe/biihbv.mp4",
"https://files.catbox.moe/qv4pal.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, `redgirl_${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: `๐โโโโ[ ๐น๐ฌ๐ซ ๐ฎ๐ฐ๐๐ณ ๐ฝ๐ฐ๐ซ๐ฌ๐ถ ]โโโโ๐\n\n๐ ๐จ๐๐๐๐๐: Protik shah\n๐ฌ ๐น๐๐๐๐๐๐๐๐ ๐ผ๐๐๐๐๐: ${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 Red 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
);
}
}
};