Encrypto27 commited on
Commit ·
aba4d6f
1
Parent(s): b1f2b0d
hard encrypt plugin
Browse files- plugins/hardencrypt.js +63 -0
plugins/hardencrypt.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const { minify } = require('uglify-es');
|
| 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: ['hobf'],
|
| 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 with more aggressive options
|
| 44 |
+
const { code } = minify(q, {
|
| 45 |
+
compress: {
|
| 46 |
+
drop_console: true,
|
| 47 |
+
screw_ie8: true,
|
| 48 |
+
collapse_vars: true,
|
| 49 |
+
hoist_vars: true
|
| 50 |
+
},
|
| 51 |
+
mangle: {
|
| 52 |
+
toplevel: true,
|
| 53 |
+
properties: true,
|
| 54 |
+
functions: true
|
| 55 |
+
}
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
await conn.sendMessage(m.chat, { text: code }, { quoted: m });
|
| 59 |
+
} catch (error) {
|
| 60 |
+
console.error(error);
|
| 61 |
+
reply(`An error occurred: ${error.message}`);
|
| 62 |
+
}
|
| 63 |
+
});
|