From 3572b97661a3f7c6c29e958b63c20d9f2ef936ac Mon Sep 17 00:00:00 2001 From: Amygdala Peanut-Almond Date: Wed, 22 Apr 2026 22:49:01 +0200 Subject: initialise repository Signed-off-by: Amygdala Peanut-Almond --- commands/exec.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 commands/exec.js (limited to 'commands/exec.js') diff --git a/commands/exec.js b/commands/exec.js new file mode 100644 index 0000000..c92b32a --- /dev/null +++ b/commands/exec.js @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Emilia Luminé + * This file is a part of the Shamestech bot. + * + * The Shamestech bot is free software: you can redistribute it and/or modify it + * under the terms of the European Union Public License as published by + * by the European Union, only the version 1.2 of the License. + * + * The Shamestech bot is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * European Union Public License for more details. + * + * You should have received a copy of the European Union Public License, If not + * see +*/ + +const childprocess = require("node:child_process"); +const util = require('node:util'); + +module.exports = { + name: 'exec', + hidden: true, + async execute(message, args) { + const prompt = args.join(' '); + let out = ''; + + if (message.author.id !== "1425229394703683614") { + return; + } + + try { + out = util.format(childprocess.execSync(prompt).toString()); + } catch (e) { + out = `${e}`; + } + + return await message.reply({ + content: `\`\`\`\n${out.length === 0 ? 'empty' : out}\n\`\`\`` + }); + } +} + -- cgit 1.4.1