// code from goatstore // api: https://store.agi.bd // romanticvideo.js // Goat Bot command: Sends a random romantic video with a random sexy caption // Install deps: npm install axios fs-extra // Place this file in your Goat Bot commands folder. const axios = require("axios"); const fs = require("fs-extra"); const path = require("path"); module.exports = { threadStates: {}, config: { name: "romanticvideo", aliases: ["rv"], version: "1.3", author: "Rocky", // โŒ Do not change this countDown: 5, role: 0, shortDescription: "Send romantic video", longDescription: "Sends a random romantic TikTok/Drive clip as video attachment with hot caption", category: "Media", guide: { en: "{p}{n} โ€” sends a random romantic video", }, }, // ๐Ÿ”’ Author protection // Fixed: the loader calls onLoad without binding `this` to module.exports, // so `this.config` was undefined here and crashed with // "Cannot read properties of undefined (reading 'author')" on every boot. // Referencing the module object directly (instead of `this`) keeps the // protection working without depending on call-site binding. onLoad: function () { if (module.exports.config.author !== "Rocky") { throw new Error("โŒ Do not change the author name! File stopped."); } }, // ๐ŸŽฅ Google Drive link normalizer normalizeDrive: function (input) { try { if (/^[a-zA-Z0-9_-]{20,}$/.test(input)) { return `https://drive.google.com/uc?export=download&id=${input}`; } const m = String(input).match(/drive\.google\.com\/file\/d\/([^/]+)/); if (m && m[1]) { return `https://drive.google.com/uc?export=download&id=${m[1]}`; } const m2 = String(input).match(/[?&]id=([^&]+)/); if (m2 && m2[1]) { return `https://drive.google.com/uc?export=download&id=${m2[1]}`; } return input; } catch { return input; } }, // ๐Ÿ”— Drive links drivePool: [ "https://drive.google.com/uc?export=download&id=1Vo4i2WAuJaDEX139r_AlWH29tMK8HnUE", "https://drive.google.com/uc?export=download&id=1yXj4M4kc4iVrg7rjv-1KMJcwoJK7U1CK", "https://drive.google.com/uc?export=download&id=18y0QSMRy66i_Xg1hMVqDWkvCwkobee9I", "https://drive.google.com/uc?export=download&id=1mAfoOgMnsy9kTGMGU8VGGsHsv8CE_L5e", "https://drive.google.com/uc?export=download&id=1-Jf9VP4J9Fda6ajWfdY9AIBYRfx0pezA", "https://drive.google.com/uc?export=download&id=1rxhztcl8toe9wmVBsOVOkSSjXLjVu6l3", "https://drive.google.com/uc?export=download&id=1DRL5DvDEy3c6pJo3fEL5cnuP3RCP4JZR", "https://drive.google.com/uc?export=download&id=16SEQAUEAIpOvzep6COOxfgs6x8Mpt7Qt", "https://drive.google.com/uc?export=download&id=1cDWQKgOegwtKMAikMplUy6zv9rS4Wpuv", "https://drive.google.com/uc?export=download&id=10I0vgh2KmYoU_AcT7PF8YFyU3V7q1cxT", "https://drive.google.com/uc?export=download&id=1V57jxhtVCAHORpxdiIkHcvAbzgWK11ZW", "https://drive.google.com/uc?export=download&id=1l7Bm2ClPsoGdrlo6DZ8PmGFHAL7hTCvv", "https://drive.google.com/uc?export=download&id=1RTFop6Ct-w4jtJjvmZgj0ZMKtiMTNiwe", "https://drive.google.com/uc?export=download&id=1k6zGxl9tkNlIzK09p3uuJjOOqyWiXtPR", "https://drive.google.com/uc?export=download&id=1hTMLi02hOEdyI1pcmRZ1SoqlPVlFjoCj", ], // ๐Ÿ’‹ Caption pool captionPool: [ "๐Ÿ”ฅ Love feels even hotter when youโ€™re watching this ๐Ÿ’‹", "๐Ÿ’ž Let the vibe melt your heartโ€ฆ and maybe a little more ๐Ÿ˜˜", "โค๏ธโ€๐Ÿ”ฅ Just a little taste of passion for you ๐Ÿ˜‰", "๐Ÿ’ซ Sparks flying, hearts racing โ€” can you feel it? ๐Ÿ’•", "๐Ÿ’‹ Mood: dangerously romantic ๐Ÿ˜", "๐Ÿ”ฅ This one will set your heart on fire ๐Ÿ’–", "๐Ÿ’ž When love gets steamy, everything glows ๐Ÿ˜˜", "โค๏ธ For the ones who love love โ€” hot and pure ๐Ÿ’ซ", "๐Ÿ’‹ Soft lips, slow beats, and deep feels ๐Ÿ˜", "๐Ÿ”ฅ Turn up the heat, itโ€™s a romantic night ๐Ÿ’ž", ], // ๐Ÿงก Main logic onStart: async function ({ api, event }) { const threadID = event.threadID; if (!this.threadStates[threadID]) this.threadStates[threadID] = {}; try { api.setMessageReaction("๐Ÿ’—", event.messageID, () => {}, true); // โœจ Send pre-message const preMsg = await api.sendMessage( "โณ๐Ÿ’– ๐€๐ฉ๐ง๐š๐ซ ๐ฏ๐ข๐๐ž๐จ ๐ญ๐ข ๐ฎ๐ฉ๐ฅ๐จ๐š๐ ๐ค๐จ๐ซ๐š ๐ก๐จ๐ฌ๐ฌ๐ž...\n๐ŸŒธ ๐Š๐ข๐ฌ๐ฎ ๐ค๐ก๐จ๐ง ๐จ๐ฉ๐ž๐ค๐ก๐š ๐ค๐จ๐ซ๐ฎ๐ง ๐Ÿ’ž\nโœจ สแดแดœส€ ส€แดแด„แด‹ส ส™แดแด› ๐Ÿ’ซ", threadID ); // Random pick const pick = this.drivePool[Math.floor(Math.random() * this.drivePool.length)]; const caption = this.captionPool[Math.floor(Math.random() * this.captionPool.length)]; const directUrl = this.normalizeDrive(pick); const cacheDir = path.join(__dirname, "cache"); await fs.ensureDir(cacheDir); const filePath = path.join(cacheDir, `romantic_${Date.now()}.mp4`); await this.downloadVideo(directUrl, filePath); if (fs.existsSync(filePath) && (await fs.stat(filePath)).size > 0) { await api.sendMessage( { body: `${caption}\n\n๐Ÿ’ ๐Ž๐ฐ๐ง๐ž๐ซ: ๐‘๐จ๐œ๐ค๐ฒ\n๐Ÿ”— ๐…๐š๐œ๐ž๐›๐จ๐จ๐ค: https://www.facebook.com/bd.king.riyaz.top.voicer.420`, attachment: fs.createReadStream(filePath), }, threadID, async () => { // ๐Ÿงน Unsend the pre-message after video is sent if (preMsg && preMsg.messageID) { try { await api.unsendMessage(preMsg.messageID); } catch {} } } ); fs.unlink(filePath).catch(() => {}); } else { api.sendMessage("โš ๏ธ Error: Video could not be saved. Try again.", threadID); if (preMsg && preMsg.messageID) api.unsendMessage(preMsg.messageID); } } catch (err) { console.error("romanticvideo error:", err?.response?.data || err); api.sendMessage("โŒ An error occurred while sending the romantic video.", threadID); } }, // ๐Ÿ“ฅ Video downloader downloadVideo: async function (url, outPath) { try { const res = await axios({ method: "GET", url, responseType: "arraybuffer", headers: { "User-Agent": "Mozilla/5.0" }, maxRedirects: 5, }); const ct = res.headers["content-type"] || ""; if (ct.includes("text/html") && !ct.includes("video")) { console.warn("Downloaded HTML instead of video; check Drive link permissions."); } await fs.writeFile(outPath, res.data); } catch (err) { console.error("Download error:", err?.response?.status, err?.message); throw err; } }, };