← back to browse
goat command

girl2

Send a non-repeating Girl 2 video from catbox collection.

0
views
0
likes
0
installs

Aliases: girl2video, g2

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: "girl2",
    aliases: ["girl2video", "g2"],
    version: "1.1",
    author: "Protik Shah",
    countDown: 5,
    role: 0,
    shortDescription: {
      en: "Send a non-repeating Girl 2 video from catbox collection."
    },
    longDescription: {
      en: "Send a non-repeating Girl 2 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/9589t8.mp4",
      "https://files.catbox.moe/752ct1.mp4",
      "https://files.catbox.moe/bc7vym.mp4",
      "https://files.catbox.moe/km7xr6.mp4",
      "https://files.catbox.moe/gvvbp8.mp4",
      "https://files.catbox.moe/r4kbtr.mp4",
      "https://files.catbox.moe/tpte65.mp4",
      "https://files.catbox.moe/2f4pss.mp4",
      "https://files.catbox.moe/ogljk1.mp4",
      "https://files.catbox.moe/r9fwc4.mp4",
      "https://files.catbox.moe/5ehn6x.mp4",
      "https://files.catbox.moe/491bcw.mp4",
      "https://files.catbox.moe/yo8sf1.mp4",
      "https://files.catbox.moe/v879cr.mp4",
      "https://files.catbox.moe/22s5a8.mp4",
      "https://files.catbox.moe/ypyk8y.mp4",
      "https://files.catbox.moe/vvc80p.mp4",
      "https://files.catbox.moe/atkkcn.mp4",
      "https://files.catbox.moe/lrhhqs.mp4",
      "https://files.catbox.moe/9i7cj5.mp4",
      "https://files.catbox.moe/pm9mao.mp4",
      "https://files.catbox.moe/nx35l3.mp4",
      "https://files.catbox.moe/ye2fil.mp4",
      "https://files.catbox.moe/jd9597.mp4",
      "https://files.catbox.moe/xb1ogm.mp4",
      "https://files.catbox.moe/1azicf.mp4",
      "https://files.catbox.moe/fq6g6h.mp4",
      "https://files.catbox.moe/g4xbvu.mp4",
      "https://files.catbox.moe/exczyw.mp4",
      "https://files.catbox.moe/t0mz5y.mp4",
      "https://files.catbox.moe/f70jo5.mp4",
      "https://files.catbox.moe/xernam.mp4",
      "https://files.catbox.moe/hfpack.mp4",
      "https://files.catbox.moe/0vl31x.mp4",
      "https://files.catbox.moe/8e8u5x.mp4",
      "https://files.catbox.moe/ci6ucl.mp4",
      "https://files.catbox.moe/r6y42w.mp4",
      "https://files.catbox.moe/mchey6.mp4",
      "https://files.catbox.moe/q16v0h.mp4",
      "https://files.catbox.moe/ulz01p.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, `girl2_${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: `🍸 [ GIRL 2 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 Girl 2 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
      );
    }
  }
};

View raw file