// code from goatstore // api: https://store.agi.bd const { exec } = require("child_process"); module.exports = { config: { name: "shell", version: "1.0", author: "KABIR4X ⚡", countDown: 5, role: 2, // Only bot admin (role 2) can use shortDescription: { en: "Execute shell commands" }, longDescription: { en: "Run terminal/shell commands from Messenger" }, category: "owner", guide: { en: "{pn} \nExample: {pn} ls -la\n{pn} node -v" } }, onStart: async function ({ args, message }) { const command = args.join(" "); if (!command) { return message.reply("Please provide a command to execute.\nExample: shell ls -la"); } exec(command, { timeout: 30000 }, (error, stdout, stderr) => { if (error) { return message.reply(`❌ Error:\n${error.message}`); } if (stderr) { return message.reply(`⚠️ Stderr:\n${stderr}`); } const output = stdout || "Command executed successfully (no output)"; // Limit message length (Messenger has limit) if (output.length > 1900) { return message.reply(output.slice(0, 1900) + "\n\n... (output truncated)"); } message.reply(`✅ Output:\n${output}`); }); } };