Upload case.js
Browse files
case.js
CHANGED
@@ -1755,33 +1755,25 @@ case 'update': {
|
|
1755 |
}
|
1756 |
break;
|
1757 |
}
|
1758 |
-
|
1759 |
-
if (!q) return reply(
|
1760 |
|
1761 |
-
await loading();
|
1762 |
-
let apiUrl = `https://api.siputzx.my.id/api/ai/flux?prompt=${encodeURIComponent(q)}`;
|
1763 |
|
1764 |
try {
|
1765 |
-
let
|
1766 |
-
let json = await response.json();
|
1767 |
-
|
1768 |
-
if (!json.status || !json.data) {
|
1769 |
-
return reply("β No image generated. Try again later.");
|
1770 |
-
}
|
1771 |
-
|
1772 |
-
let imageUrl = json.data;
|
1773 |
|
1774 |
await conn.sendMessage(m.chat, {
|
1775 |
image: { url: imageUrl },
|
1776 |
-
caption: fontx(`π¨ *Flux AI Generated Image*\n\nπ *Prompt:* ${q}\n
|
1777 |
-
});
|
1778 |
|
1779 |
} catch (error) {
|
1780 |
-
console.error("Error
|
1781 |
-
reply("β
|
1782 |
}
|
1783 |
break;
|
1784 |
-
}
|
1785 |
case 'blackbox': {
|
1786 |
if (!q) return reply("β Please enter a question or prompt.\n\nExample: .blackbox How do I code in JavaScript?");
|
1787 |
await loading();
|
|
|
1755 |
}
|
1756 |
break;
|
1757 |
}
|
1758 |
+
case 'flux': {
|
1759 |
+
if (!q) return reply(`β Please enter a prompt.\n\nExample: *${prefix + command} create a cyberpunk lizard image*`);
|
1760 |
|
1761 |
+
await loading(); // Display loading message
|
|
|
1762 |
|
1763 |
try {
|
1764 |
+
let imageUrl = `https://api.siputzx.my.id/api/ai/flux?prompt=${encodeURIComponent(q)}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1765 |
|
1766 |
await conn.sendMessage(m.chat, {
|
1767 |
image: { url: imageUrl },
|
1768 |
+
caption: fontx(`π¨ *Flux AI Generated Image*\n\nπ *Prompt:* ${q}\n> ${caption}`),
|
1769 |
+
}, { quoted: m });
|
1770 |
|
1771 |
} catch (error) {
|
1772 |
+
console.error("Error in flux case:", error);
|
1773 |
+
reply("β An error occurred while generating the image. Please try again later.");
|
1774 |
}
|
1775 |
break;
|
1776 |
+
}
|
1777 |
case 'blackbox': {
|
1778 |
if (!q) return reply("β Please enter a question or prompt.\n\nExample: .blackbox How do I code in JavaScript?");
|
1779 |
await loading();
|