𝗗𝗔π—₯π—₯π—˜π—Ÿπ—Ÿ π— π—¨π—–π—›π—˜π—₯π—œ ⚑ commited on
Commit
c9141fa
Β·
unverified Β·
1 Parent(s): 03f4eea

Update ai-stablediffusion.js

Browse files
Files changed (1) hide show
  1. plugins/ai-stablediffusion.js +51 -46
plugins/ai-stablediffusion.js CHANGED
@@ -1,47 +1,52 @@
1
 
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
- const _0x1131bd=_0x5e3b;function _0x5e3b(_0x18a359,_0x174e5a){const _0x301da0=_0x301d();return _0x5e3b=function(_0x5e3bf7,_0x3e63a0){_0x5e3bf7=_0x5e3bf7-0x8d;let _0xa450a3=_0x301da0[_0x5e3bf7];return _0xa450a3;},_0x5e3b(_0x18a359,_0x174e5a);}function _0x301d(){const _0xd3c544=['message','imagine','error','450692slHpnu','6089185QTiccB','https://api.davidcyriltech.my.id/diffusion?prompt=','1215212oJimPl','127806MBDdBY','6JBaowk','4VIxgaY','chat','>\x20*Subzero\x20Diffussing\x20Your\x20image...*','sendMessage','../command','../config','547630xwdQMS','5991256ImWqek','main','\x1aβ€β€ž','9330SWmhGb','7fDFEWt','Please\x20provide\x20a\x20prompt\x20for\x20the\x20image.','../lib/functions','result','7893OgfXbE','log'];_0x301d=function(){return _0xd3c544;};return _0x301d();}(function(_0x4d2141,_0x4bf5f4){const _0x26f75d=_0x5e3b,_0x19b7c8=_0x4d2141();while(!![]){try{const _0x4555ff=parseInt(_0x26f75d(0x8e))/0x1+parseInt(_0x26f75d(0x97))/0x2*(parseInt(_0x26f75d(0x90))/0x3)+-parseInt(_0x26f75d(0x91))/0x4*(parseInt(_0x26f75d(0xa6))/0x5)+-parseInt(_0x26f75d(0x8f))/0x6*(-parseInt(_0x26f75d(0x9c))/0x7)+-parseInt(_0x26f75d(0x98))/0x8+-parseInt(_0x26f75d(0xa0))/0x9*(-parseInt(_0x26f75d(0x9b))/0xa)+parseInt(_0x26f75d(0xa5))/0xb;if(_0x4555ff===_0x4bf5f4)break;else _0x19b7c8['push'](_0x19b7c8['shift']());}catch(_0x1a237b){_0x19b7c8['push'](_0x19b7c8['shift']());}}}(_0x301d,0xa5304));function hi(){const _0x3a4e36=_0x5e3b;console[_0x3a4e36(0xa1)]('Hello\x20World!');}hi();const config=require(_0x1131bd(0x96)),{cmd,commands}=require(_0x1131bd(0x95)),{fetchJson}=require(_0x1131bd(0x9e));cmd({'pattern':'stablediffussion','alias':['sd',_0x1131bd(0xa3)],'react':_0x1131bd(0x9a),'desc':'Generate\x20an\x20image\x20using\x20AI.','category':_0x1131bd(0x99),'filename':__filename},async(_0x2db266,_0x541e5c,_0x30c125,{from:_0x17baba,quoted:_0xd493f5,body:_0x56552f,isCmd:_0x1d36e2,command:_0xe01451,args:_0x23e994,q:_0x363686,isGroup:_0x15ba6a,sender:_0x2e9bd2,senderNumber:_0x43d229,botNumber2:_0x438e04,botNumber:_0x10f1c9,pushname:_0x5247a4,isMe:_0x384ad0,isOwner:_0x5d7f20,groupMetadata:_0x1e7b8c,groupName:_0x3af620,participants:_0x119183,groupAdmins:_0x59cc1b,isBotAdmins:_0x7e05e0,isAdmins:_0x1bf3da,reply:_0x2c7dec})=>{const _0x17d69a=_0x1131bd;try{if(!_0x363686)return _0x2c7dec(_0x17d69a(0x9d));await _0x2c7dec(_0x17d69a(0x93));let _0x4ad080=await fetchJson(_0x17d69a(0x8d)+_0x363686);const _0x2ebc84=_0x4ad080[_0x17d69a(0x9f)];await _0x2db266[_0x17d69a(0x94)](_0x30c125[_0x17d69a(0x92)],{'image':{'url':_0x2ebc84}});}catch(_0x112f5a){console[_0x17d69a(0xa4)](_0x112f5a),_0x2c7dec('An\x20error\x20occurred:\x20'+_0x112f5a[_0x17d69a(0xa2)]);}});
47
-
 
 
 
 
 
 
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.",
11
+ category: "main",
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.davidcyriltech.my.id/diffusion?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
+ });