Download plugins/exec.js from Ikygantengbangetanjay/testingba: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/spaces/Ikygantengbangetanjay/testingba/resolve/main/plugins/exec.js
- Command line
-
hf download hf://spaces/Ikygantengbangetanjay/testingba/plugins/exec.js
-
curl -L -o exec.js https://huggingface.co/spaces/Ikygantengbangetanjay/testingba/resolve/main/plugins/exec.js
609 Bytes
| let cp = require("child_process"); | |
| let { promisify } = require("util"); | |
| let exec = promisify(cp.exec).bind(cp); | |
| let handler = async (m, { conn, isOwner, command, text }) => { | |
| if (global.conn.user.jid != conn.user.jid) return; | |
| m.reply("Executing..."); | |
| let o; | |
| try { | |
| o = await exec(command.trimStart() + " " + text.trimEnd()); | |
| } catch (e) { | |
| o = e; | |
| } finally { | |
| let { stdout, stderr } = o; | |
| if (stdout.trim()) m.reply(stdout); | |
| if (stderr.trim()) m.reply(stderr); | |
| } | |
| }; | |
| handler.customPrefix = /^[$] /; | |
| handler.command = new RegExp(); | |
| handler.rowner = true; | |
| module.exports = handler; | |