// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const fs = require("fs"); const path = require("path"); module.exports = { config: { name: "imagine", aliases: ["img"], version: "1.2.2", author: "MaRuF", role: 0, category: "ai", guide: "{pn} " }, onStart: async function ({ api, event, args }) { const { threadID, messageID } = event; const prompt = args.join(" "); if (!prompt) { return api.sendMessage("✨ Usage: imagine ", threadID, messageID); } const waitMsg = await api.sendMessage("šŸŽØ Generating...", threadID); try { // Direct pollinations link. No download, no cache const imageUrl = `https://image.pollinations.ai/prompt/${encodeURIComponent(prompt)}?width=1024&height=1024&nologo=true&seed=${Date.now()}`; // Check if link is valid await axios.head(imageUrl, { timeout: 10000 }); const msg = { body: `šŸŽØ **Imagine AI**\n\nšŸ“ ${prompt}\nšŸ”— Direct Link: ${imageUrl}`, attachment: await global.utils.getStreamFromURL(imageUrl) // jodi tomar utils e thake }; api.sendMessage(msg, threadID, () => { api.unsendMessage(waitMsg.messageID); }); } catch (error) { api.unsendMessage(waitMsg.messageID); // Jodi attachment e problem hoy tahole sudhu link pathabo const imageUrl = `https://image.pollinations.ai/prompt/${encodeURIComponent(prompt)}?width=1024&height=1024&nologo=true&seed=${Date.now()}`; api.sendMessage(`šŸŽØ **Imagine AI**\n\nšŸ“ ${prompt}\n\nImage ready: ${imageUrl}`, threadID, messageID); } } };