// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const Canvas = require("canvas"); const fs = require("fs"); const path = require("path"); module.exports = { config: { name: "pair3", aliases: ["3", "pair 3"], version: "4.0", author: "Jihad", role: 0, countDown: 5, shortDescription: "Cute romantic pair system", category: "FUN & SOCIAL" }, onStart: async function ({ api, event, usersData }) { const { threadID, messageID, senderID } = event; try { // Reply / Mention target let targetID = event.messageReply?.senderID || Object.keys(event.mentions || {})[0]; if (!targetID) { return api.sendMessage( "⚠️ কাউকে Reply অথবা Mention করে 3 দিন!", threadID, messageID ); } const [me, target] = await Promise.all([ usersData.get(senderID), usersData.get(targetID) ]); const myName = me?.name || "You"; const targetName = target?.name || "Someone"; const match = Math.floor(Math.random() * 31) + 70; const canvas = Canvas.createCanvas(1600, 900); const ctx = canvas.getContext("2d"); // Background const bg = ctx.createLinearGradient(0, 0, 1600, 900); bg.addColorStop(0, "#1a0033"); bg.addColorStop(0.3, "#2d004d"); bg.addColorStop(0.6, "#4a0066"); bg.addColorStop(1, "#2d004d"); ctx.fillStyle = bg; ctx.fillRect(0, 0, 1600, 900); // Small particles for (let i = 0; i < 220; i++) { ctx.fillStyle = `rgba(255,200,255,${Math.random() * 0.5})`; ctx.beginPath(); ctx.arc( Math.random() * 1600, Math.random() * 900, Math.random() * 2.5, 0, Math.PI * 2 ); ctx.fill(); } // Floating hearts for (let i = 0; i < 65; i++) { ctx.font = `${18 + Math.random() * 30}px sans-serif`; ctx.globalAlpha = 0.2 + Math.random() * 0.4; ctx.fillText( ["💗", "💖", "💕", "💞"][ Math.floor(Math.random() * 4) ], Math.random() * 1600, Math.random() * 900 ); } ctx.globalAlpha = 1; // Border ctx.shadowColor = "#ff66cc"; ctx.shadowBlur = 20; ctx.strokeStyle = "#ff66cc"; ctx.lineWidth = 5; ctx.strokeRect(20, 20, 1560, 860); ctx.shadowBlur = 0; // Corner hearts ctx.font = "60px sans-serif"; ctx.fillText("💖", 45, 85); ctx.fillText("💖", 1490, 85); ctx.fillText("💖", 45, 865); ctx.fillText("💖", 1490, 865); // Title ctx.textAlign = "center"; ctx.shadowColor = "#ff66cc"; ctx.shadowBlur = 15; ctx.font = "bold 64px Arial"; ctx.fillStyle = "#ff99ff"; ctx.fillText( "💕 PERFECT MATCH 💕", 800, 120 ); ctx.font = "30px Arial"; ctx.fillStyle = "#ffccff"; ctx.fillText( "✧ A Match Made in Heaven ✧", 800, 170 ); ctx.shadowBlur = 0; // Token const token = "6628568379|c1e620fa708a1d5696fb991c1bde5662"; async function getAvatar(id) { const res = await axios.get( `https://graph.facebook.com/${id}/picture?width=1024&height=1024&access_token=${token}`, { responseType: "arraybuffer", headers: { "User-Agent": "Mozilla/5.0" }, timeout: 15000 } ); return Canvas.loadImage(res.data); } const [img1, img2] = await Promise.all([ getAvatar(senderID), getAvatar(targetID) ]); // Premium circular avatar function drawAvatar(img, x, y) { const size = 320; ctx.shadowColor = "#ff66cc"; ctx.shadowBlur = 30; ctx.fillStyle = "#ff66cc"; ctx.beginPath(); ctx.arc( x + size / 2, y + size / 2, size / 2 + 20, 0, Math.PI * 2 ); ctx.fill(); ctx.shadowBlur = 0; ctx.fillStyle = "#fff"; ctx.beginPath(); ctx.arc( x + size / 2, y + size / 2, size / 2 + 11, 0, Math.PI * 2 ); ctx.fill(); ctx.save(); ctx.beginPath(); ctx.arc( x + size / 2, y + size / 2, size / 2, 0, Math.PI * 2 ); ctx.clip(); ctx.drawImage( img, x, y, size, size ); ctx.restore(); ctx.strokeStyle = "#ff99ff"; ctx.lineWidth = 5; ctx.beginPath(); ctx.arc( x + size / 2, y + size / 2, size / 2 - 3, 0, Math.PI * 2 ); ctx.stroke(); // Crown ctx.font = "48px sans-serif"; ctx.fillText( "👑", x + size / 2, y - 15 ); // Hearts around picture ctx.font = "32px sans-serif"; for (let i = 0; i < 8; i++) { const a = (i * Math.PI * 2) / 8; const hx = x + size / 2 + Math.cos(a) * (size / 2 + 28); const hy = y + size / 2 + Math.sin(a) * (size / 2 + 28); ctx.fillText("💗", hx, hy); } } drawAvatar(img1, 240, 260); drawAvatar(img2, 1040, 260); // Center heart ctx.shadowColor = "#ff3399"; ctx.shadowBlur = 25; ctx.font = "150px sans-serif"; ctx.fillText( "💗", 800, 490 ); ctx.shadowBlur = 0; // Match circle const cx = 800; const cy = 625; const radius = 82; ctx.beginPath(); ctx.arc( cx, cy, radius, 0, Math.PI * 2 ); ctx.strokeStyle = "rgba(255,102,204,0.3)"; ctx.lineWidth = 12; ctx.stroke(); ctx.beginPath(); ctx.arc( cx, cy, radius, -Math.PI / 2, -Math.PI / 2 + (match / 100) * Math.PI * 2 ); ctx.strokeStyle = "#ff66cc"; ctx.lineWidth = 12; ctx.stroke(); ctx.font = "bold 50px Arial"; ctx.fillStyle = "#ff99ff"; ctx.fillText( `${match}%`, 800, 620 ); ctx.font = "23px Arial"; ctx.fillStyle = "#ffccff"; ctx.fillText( "MATCH", 800, 660 ); // Perfect Pair ctx.font = "bold 38px Arial"; ctx.fillStyle = "#ffccff"; ctx.fillText( "✦ PERFECT PAIR ✦", 800, 755 ); // Names let name1 = String(myName); let name2 = String(targetName); if (name1.length > 15) name1 = name1.slice(0, 15) + "..."; if (name2.length > 15) name2 = name2.slice(0, 15) + "..."; ctx.font = "bold 42px Arial"; ctx.fillStyle = "#fff"; ctx.fillText( name1, 400, 830 ); ctx.fillText( name2, 1200, 830 ); // Footer ctx.font = "26px Arial"; ctx.fillStyle = "#ffccff"; ctx.fillText( "✨ A beautiful love story begins here ✨", 800, 870 ); // Save const cacheDir = path.join(__dirname, "cache"); if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, { recursive: true }); const file = path.join( cacheDir, `pair3_${Date.now()}.png` ); fs.writeFileSync( file, canvas.toBuffer() ); return api.sendMessage( { body: `💗 𝗣𝗘𝗥𝗙𝗘𝗖𝗧 𝗣𝗔𝗜𝗥 👤 ${name1} ✦ 👤 ${name2} 💞 ${match}% Match 💘 Status: Matched!`, attachment: fs.createReadStream(file) }, threadID, () => { if (fs.existsSync(file)) fs.unlinkSync(file); }, messageID ); } catch (err) { console.log("PAIR3 ERROR:", err); return api.sendMessage( "❌ Pair3 failed!", threadID, messageID ); } } };