Created
July 8, 2025 16:38
-
-
Save dipto-008/42b22d943058c59e3d6ed2f2875abb31 to your computer and use it in GitHub Desktop.
Hey noob ππ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios"); | |
const fs = require("fs-extra"); | |
const path = require("path"); | |
const { GoatWrapper } = require("fca-liane-utils"); | |
module.exports = { | |
config: { | |
name: "flux1pro", | |
aliases: [], | |
version: "1.0", | |
author: "Ew'r Saim", | |
countDown: 5, | |
role: 0, | |
description: { | |
vi: "Flux 1.1 Pro model diye AI image toiri koro", | |
en: "Flux 1.1 Pro model diye AI chobi banan" | |
}, | |
category: "image generator", | |
guide: { | |
en: "<prompt> type kore AI image banate parben\nπ§ͺ Example: Naruto, glowing armor, cinematic lighting", | |
vi: "<prompt> type kore AI image banate parben\nπ§ͺ Example: Naruto, glowing armor, cinematic lighting" | |
} | |
}, | |
onStart: async function ({ message, event, args, api }) { | |
const prompt = args.join(" "); | |
const commandName = this.config.name; | |
if (!prompt) | |
return message.reply("β οΈ Please provide a prompt.\nExample: Naruto, glowing armor, cinematic lighting"); | |
api.setMessageReaction("π§¬", event.messageID, () => {}, true); | |
message.reply("π¨ Generating your Flux 1.1 Pro image...", async (info) => { | |
const encodedPrompt = encodeURIComponent(prompt); | |
const url = `https://api.oculux.xyz/api/flux-1.1-pro?prompt=${encodedPrompt}`; | |
const imgPath = path.join(__dirname, "cache", `${commandName}_${event.senderID}.png`); | |
try { | |
const res = await axios.get(url, { responseType: "arraybuffer" }); | |
fs.writeFileSync(imgPath, res.data); | |
message.reply({ | |
body: `β | Here's Your Generated ${commandName} Image`, | |
attachment: fs.createReadStream(imgPath) | |
}, () => { | |
fs.unlinkSync(imgPath); | |
api.unsendMessage(info.messageID); | |
}); | |
} catch (err) { | |
console.error("Image generation failed:", err); | |
message.reply("β Failed to generate the image. Please try again later."); | |
} | |
}); | |
}, | |
}; | |
const wrapper = new GoatWrapper(module.exports); | |
wrapper.applyNoPrefix({ allowPrefix: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment