// code from goatstore // api: https://store.agi.bd const GIFEncoder = require("gifencoder"); const { createCanvas, loadImage } = require("canvas"); const fs = require("fs-extra"); module.exports = { config: { name: "groupinfo", aliases: ["ginfo"], version: "1.0", author: "Zihad", countDown: 15, role: 0, description: "গ্রুপের তথ্য লাইভ অ্যানিমেটেড GIF-এ দেখাবে", category: "group", guide: "{pn}" }, onStart: async function ({ api, event, message }) { const info = await api.getThreadInfo(event.threadID); const lines = [ `নাম: ${info.threadName || "Unnamed"}`, `ID: ${event.threadID}`, `মেম্বার: ${info.participantIDs.length}`, `অ্যাডমিন: ${info.adminIDs.length}`, `মেসেজ: ${info.messageCount || "N/A"}`, `ইমোজি: ${info.emoji || "👍"}`, `অ্যাপ্রুভাল: ${info.approvalMode ? "অন" : "অফ"}` ]; let avatar = null; try { if (info.imageSrc) avatar = await loadImage(info.imageSrc); } catch (e) {} const w = 600, h = 360, frames = 28; const dir = __dirname + "/cache"; fs.ensureDirSync(dir); const path = `${dir}/ginfo_${Date.now()}.gif`; const enc = new GIFEncoder(w, h); const out = enc.createReadStream().pipe(fs.createWriteStream(path)); enc.start(); enc.setRepeat(0); enc.setDelay(90); enc.setQuality(15); const ctx = createCanvas(w, h).getContext("2d"); for (let i = 0; i < frames; i++) { const hue = (i * 360) / frames; // চলমান গ্রেডিয়েন্ট ব্যাকগ্রাউন্ড const g = ctx.createLinearGradient(0, 0, w, h); g.addColorStop(0, `hsl(${hue}, 70%, 15%)`); g.addColorStop(1, `hsl(${(hue + 80) % 360}, 70%, 25%)`); ctx.fillStyle = g; ctx.fillRect(0, 0, w, h); // ভাসমান বৃত্ত for (let k = 0; k < 6; k++) { const x = (k * 110 + i * 8) % w; const y = h - ((k * 70 + i * 12) % h); ctx.fillStyle = `hsla(${(hue + k * 40) % 360}, 90%, 60%, 0.15)`; ctx.beginPath(); ctx.arc(x, y, 14 + k * 3, 0, Math.PI * 2); ctx.fill(); } // গ্রুপ ছবি + স্পন্দিত রিং const cx = 90, cy = 110, r = 50; const pulse = 6 + Math.sin((i / frames) * Math.PI * 2) * 6; ctx.strokeStyle = `hsl(${hue}, 100%, 65%)`; ctx.lineWidth = 4; ctx.beginPath(); ctx.arc(cx, cy, r + pulse, 0, Math.PI * 2); ctx.stroke(); ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, Math.PI * 2); ctx.clip(); if (avatar) ctx.drawImage(avatar, cx - r, cy - r, r * 2, r * 2); else { ctx.fillStyle = "#333"; ctx.fillRect(cx - r, cy - r, r * 2, r * 2); } ctx.restore(); // টাইটেল ctx.fillStyle = "#fff"; ctx.font = "bold 26px sans-serif"; ctx.textAlign = "left"; ctx.fillText("GROUP INFO", 170, 60); // LIVE ব্লিংকিং ডট if (i % 4 < 2) { ctx.fillStyle = "#ff2b2b"; ctx.beginPath(); ctx.arc(440, 52, 7, 0, Math.PI * 2); ctx.fill(); } ctx.fillStyle = "#fff"; ctx.font = "bold 16px sans-serif"; ctx.fillText("LIVE", 455, 58); // টাইপরাইটার ইফেক্টে লাইন const shown = Math.min(lines.length, Math.floor((i / (frames - 6)) * lines.length) + 1); ctx.font = "20px sans-serif"; for (let j = 0; j < shown; j++) { ctx.fillStyle = j % 2 ? "#e8e8e8" : `hsl(${hue}, 100%, 80%)`; ctx.fillText(lines[j].slice(0, 38), 170, 105 + j * 34); } } enc.finish(); await new Promise(r => out.on("finish", r)); await message.reply({ attachment: fs.createReadStream(path) }); fs.unlinkSync(path); } };