// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const API_BASE = "https://hridoy-api.onrender.com"; const CMD_NAME = "edit3"; module.exports = { config: { name: "edit3", version: "2.0", author: "HR ID OY", countDown: 5, role: 0, shortDescription: "Edit image with AI", category: "Image", guide: "{pn} [reply to image] [text]" }, onStart: async function ({ api, event, args }) { const react = (e) => api.setMessageReaction(e, event.messageID, () => {}, true); const prompt = args.join(" "); if (!prompt) { react("āš ļø"); return api.sendMessage("āš ļø Please provide text.", event.threadID); } const imageUrl = event.messageReply?.attachments[0]?.url; if (!imageUrl) { react("šŸ–¼ļø"); return api.sendMessage("šŸ–¼ļø Please reply to an image.", event.threadID); } react("ā³"); const config = (await axios.get(`${API_BASE}/api/links/${CMD_NAME}`)).data; const apiUrl = `${config.url}?url=${encodeURIComponent(imageUrl)}&prompt=${encodeURIComponent(prompt)}`; const response = await axios.get(apiUrl, { responseType: "stream" }); react("āœ…"); api.sendMessage({ body: `āœ… Image edited!\nšŸ“ Prompt: ${prompt}`, attachment: response.data }, event.threadID); } };