Cloner / plugins /ai-fluxpro.js
Encrypto27
x github cmd
5846f1b
// Thats Why You Are Single🥲😂
/*
$$$$$$\ $$\
$$ __$$\ $$ |
$$ / \__|$$\ $$\ $$$$$$$\ $$$$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\
\$$$$$$\ $$ | $$ |$$ __$$\ \____$$ |$$ __$$\ $$ __$$\ $$ __$$\
\____$$\ $$ | $$ |$$ | $$ | $$$$ _/ $$$$$$$$ |$$ | \__|$$ / $$ |
$$\ $$ |$$ | $$ |$$ | $$ | $$ _/ $$ ____|$$ | $$ | $$ |
\$$$$$$ |\$$$$$$ |$$$$$$$ |$$$$$$$$\ \$$$$$$$\ $$ | \$$$$$$ |
\______/ \______/ \_______/ \________| \_______|\__| \______/
Project Name : ENCRYPTO-27
Creator : Diego Allies ( DUDAS OFC )
Repo : https//github.com/mrfrank-ofc/ENCRYPTO-27
Support : wa.me/27679291800
*/
const config = require('../config');
const { cmd, commands } = require('../command');
const { fetchJson } = require('../lib/functions');
cmd({
pattern: 'fluxpro',
react: '🧩',
desc: 'Generate an image using Flux',
category: 'image',
filename: __filename
}, async (conn, mek, m, {
body,
from,
quoted,
isCmd,
command,
args,
q,
isGroup,
sender,
senderNumber,
botNumber2,
botNumber,
pushname,
isMe,
isOwner,
groupMetadata,
groupName,
participants,
groupAdmins,
isBotAdmins,
isAdmins,
reply
}) => {
try {
const text = body.trim().replace(command, '').trim();
if (!text) {
return reply(`*Usage:* ${command} <prompt>\n\n*Example:* ${command} cat`);
}
await reply('> *ENCRYPTO-27 Processing Image...*');
const apiUrl = `https://api.davidcyriltech.my.id/flux?prompt=${encodeURIComponent(text)}`;
await conn.sendMessage(m.chat, { image: { url: apiUrl }, caption: `🎨 *Flux Image Generator*\n\n📄 *Prompt:* ${text}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴍʀ ғʀᴀɴᴋ` }, { quoted: m });
} catch (error) {
console.error('Error in Flux command:', error);
reply(`*AN ERROR OCCURRED!! MESSAGE :*\n\n> ${error.message}`);
}
});