Encrypto27 commited on
Commit
4563f53
·
1 Parent(s): 17f09ba

encryption code

Browse files
Files changed (2) hide show
  1. package.json +2 -1
  2. plugins/encrypt.js +58 -0
package.json CHANGED
@@ -43,6 +43,7 @@
43
  "api-dylux":"1.8.5",
44
  "@mrnima/tiktok-downloader":"1.0.0",
45
  "@mrnima/facebook-downloader":"1.0.0",
46
- "mrnima-moviedl":"1.0.0"
 
47
  }
48
  }
 
43
  "api-dylux":"1.8.5",
44
  "@mrnima/tiktok-downloader":"1.0.0",
45
  "@mrnima/facebook-downloader":"1.0.0",
46
+ "mrnima-moviedl":"1.0.0",
47
+ "uglify-js": "^3.18.6" // Add uglify-js to dependencies
48
  }
49
  }
plugins/encrypt.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const UglifyJS = require('uglify-js');
2
+
3
+ const config = require('../config');
4
+ const { cmd, commands } = require('../command');
5
+ const { fetchJson } = require('../lib/functions'); // Assuming this fetches JSON from a different source
6
+
7
+ cmd({
8
+ pattern: 'obfuscate',
9
+ alias: ['obf'],
10
+ react: '🗿',
11
+ desc: 'Minifies JavaScript code (using UglifyJS).', // Update description
12
+ category: 'main',
13
+ filename: __filename
14
+ }, async (conn, mek, m, {
15
+ from,
16
+ quoted,
17
+ body,
18
+ isCmd,
19
+ command,
20
+ args,
21
+ q,
22
+ isGroup,
23
+ sender,
24
+ senderNumber,
25
+ botNumber2,
26
+ botNumber,
27
+ pushname,
28
+ isMe,
29
+ isOwner,
30
+ groupMetadata,
31
+ groupName,
32
+ participants,
33
+ groupAdmins,
34
+ isBotAdmins,
35
+ isAdmins,
36
+ reply
37
+ }) => {
38
+ try {
39
+ if (!q) return reply('Please provide JavaScript code to minify.');
40
+
41
+ await reply('> *Minifying code...*'); // Update message
42
+
43
+ // Minify the code using UglifyJS
44
+ const minifiedCode = UglifyJS.minify(q, {
45
+ compress: {
46
+ drop_console: true // Remove console.log statements (optional)
47
+ },
48
+ mangle: {
49
+ toplevel: true // Mangle global variables (optional)
50
+ }
51
+ }).code;
52
+
53
+ await conn.sendMessage(m.chat, { text: minifiedCode }, { quoted: m });
54
+ } catch (error) {
55
+ console.error(error);
56
+ reply(`An error occurred: ${error.message}`);
57
+ }
58
+ });