const UglifyJS = require('uglify-js'); const config = require('../config'); const { cmd, commands } = require('../command'); const { fetchJson } = require('../lib/functions'); // Assuming this fetches JSON from a different source cmd({ pattern: 'obfuscate', alias: ['obf'], react: '🗿', desc: 'Minifies JavaScript code (using UglifyJS).', category: 'main', filename: __filename }, async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { if (!q) return reply('Please provide JavaScript code to minify.'); try { // Minify the code using UglifyJS const minifiedCode = UglifyJS.minify(q, { compress: { drop_console: true, // Remove console.log statements (optional) // screw_ie8: true, // collapse_vars: true, // hoist_vars: true }, mangle: { toplevel: true, // Mangle global variables (optional) // properties: true, // functions: true } }).code; await conn.sendMessage(m.chat, { text: minifiedCode }, { quoted: m }); } catch (error) { console.error(error); reply(`An error occurred: ${error.message}`); } });