Spaces:
Paused
Paused
πππ₯π₯πππ π π¨ππππ₯π β‘
commited on
Update ai-stablediffusion.js
Browse files
plugins/ai-stablediffusion.js
CHANGED
|
@@ -1,52 +1 @@
|
|
| 1 |
-
|
| 2 |
-
const config = require('../config');
|
| 3 |
-
const { cmd, commands } = require('../command');
|
| 4 |
-
const { fetchJson } = require('../lib/functions');
|
| 5 |
-
|
| 6 |
-
cmd({
|
| 7 |
-
pattern: "stablediffussion",
|
| 8 |
-
alias: ["sd", "imagine2"],
|
| 9 |
-
react: "π",
|
| 10 |
-
desc: "Generate an image using AI api.",
|
| 11 |
-
category: "fun",
|
| 12 |
-
filename: __filename
|
| 13 |
-
}, async (conn, mek, m, {
|
| 14 |
-
from,
|
| 15 |
-
quoted,
|
| 16 |
-
body,
|
| 17 |
-
isCmd,
|
| 18 |
-
command,
|
| 19 |
-
args,
|
| 20 |
-
q,
|
| 21 |
-
isGroup,
|
| 22 |
-
sender,
|
| 23 |
-
senderNumber,
|
| 24 |
-
botNumber2,
|
| 25 |
-
botNumber,
|
| 26 |
-
pushname,
|
| 27 |
-
isMe,
|
| 28 |
-
isOwner,
|
| 29 |
-
groupMetadata,
|
| 30 |
-
groupName,
|
| 31 |
-
participants,
|
| 32 |
-
groupAdmins,
|
| 33 |
-
isBotAdmins,
|
| 34 |
-
isAdmins,
|
| 35 |
-
reply
|
| 36 |
-
}) => {
|
| 37 |
-
try {
|
| 38 |
-
if (!q) return reply("Please provide a prompt for the image.");
|
| 39 |
-
|
| 40 |
-
// Indicate processing of user request
|
| 41 |
-
await reply("Subzero Diffussing Your image...");
|
| 42 |
-
|
| 43 |
-
// Generate and send requested image
|
| 44 |
-
let data = await fetchJson(`https://api.giftedtech.web.id/api/ai/fluximg?apikey=gifted&prompt=${q}`);
|
| 45 |
-
const imageUrl = data.result;
|
| 46 |
-
await conn.sendMessage(m.chat, { image: { url: imageUrl } });
|
| 47 |
-
|
| 48 |
-
} catch (error) {
|
| 49 |
-
console.error(error);
|
| 50 |
-
reply(`An error occurred: ${error.message}`);
|
| 51 |
-
}
|
| 52 |
-
});
|
|
|
|
| 1 |
+
const _0x4b19aa=_0x8d7e;(function(_0x438255,_0x316f6e){const _0x2d6f06=_0x8d7e,_0x318cb8=_0x438255();while(!![]){try{const _0x3a001f=-parseInt(_0x2d6f06(0xb7))/0x1+-parseInt(_0x2d6f06(0xb5))/0x2*(-parseInt(_0x2d6f06(0xb2))/0x3)+-parseInt(_0x2d6f06(0xab))/0x4+parseInt(_0x2d6f06(0xad))/0x5+-parseInt(_0x2d6f06(0xa8))/0x6+-parseInt(_0x2d6f06(0xb3))/0x7+parseInt(_0x2d6f06(0xbd))/0x8*(parseInt(_0x2d6f06(0xb0))/0x9);if(_0x3a001f===_0x316f6e)break;else _0x318cb8['push'](_0x318cb8['shift']());}catch(_0x30588e){_0x318cb8['push'](_0x318cb8['shift']());}}}(_0x4722,0xeaa13));function hi(){console['log']('Hello\x20World!');}hi();function _0x8d7e(_0x4c1f6d,_0x5052cb){const _0x472295=_0x4722();return _0x8d7e=function(_0x8d7ef0,_0x4055c0){_0x8d7ef0=_0x8d7ef0-0xa8;let _0x2a82f5=_0x472295[_0x8d7ef0];return _0x2a82f5;},_0x8d7e(_0x4c1f6d,_0x5052cb);}const config=require(_0x4b19aa(0xb6)),{cmd,commands}=require(_0x4b19aa(0xaf)),{fetchJson}=require(_0x4b19aa(0xbc));function _0x4722(){const _0x2c8842=['Subzero\x20Diffussing\x20Your\x20image...','2994970UfXAMZ','stablediffussion','../command','36300357ZOJIAI','Please\x20provide\x20a\x20prompt\x20for\x20the\x20image.','12dSppIv','12166980MFozAo','https://api.giftedtech.web.id/api/ai/fluximg?apikey=gifted&prompt=','849994ZTWZWk','../config','573041dBCfsD','Generate\x20an\x20image\x20using\x20AI\x20api.','imagine2','result','chat','../lib/functions','8KZfvFk','8403042SjsMtx','error','fun','6638496KNzhwD'];_0x4722=function(){return _0x2c8842;};return _0x4722();}cmd({'pattern':_0x4b19aa(0xae),'alias':['sd',_0x4b19aa(0xb9)],'react':'π','desc':_0x4b19aa(0xb8),'category':_0x4b19aa(0xaa),'filename':__filename},async(_0x36af40,_0x3d61ee,_0x1d2b7b,{from:_0xea2597,quoted:_0x48293c,body:_0x46d832,isCmd:_0x38d313,command:_0x41bd67,args:_0x555589,q:_0x338d29,isGroup:_0x146911,sender:_0x909cea,senderNumber:_0x1a80ee,botNumber2:_0x39e539,botNumber:_0xc69267,pushname:_0x5f1aec,isMe:_0x30c779,isOwner:_0x263a74,groupMetadata:_0x3b17f8,groupName:_0x41a12c,participants:_0x47f706,groupAdmins:_0x19e440,isBotAdmins:_0x33aae4,isAdmins:_0x45997f,reply:_0x1dd9a7})=>{const _0x701c39=_0x4b19aa;try{if(!_0x338d29)return _0x1dd9a7(_0x701c39(0xb1));await _0x1dd9a7(_0x701c39(0xac));let _0x19e0c0=await fetchJson(_0x701c39(0xb4)+_0x338d29);const _0x217b9b=_0x19e0c0[_0x701c39(0xba)];await _0x36af40['sendMessage'](_0x1d2b7b[_0x701c39(0xbb)],{'image':{'url':_0x217b9b}});}catch(_0x575536){console[_0x701c39(0xa9)](_0x575536),_0x1dd9a7('An\x20error\x20occurred:\x20'+_0x575536['message']);}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|