Skip to content

Instantly share code, notes, and snippets.

@dipto-008
Created July 8, 2025 16:38
Show Gist options
  • Save dipto-008/42b22d943058c59e3d6ed2f2875abb31 to your computer and use it in GitHub Desktop.
Save dipto-008/42b22d943058c59e3d6ed2f2875abb31 to your computer and use it in GitHub Desktop.
Hey noob πŸ‘‹πŸ‘‹
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