From 872d08be3ed8c4568a9d29dceff5f2270a55b00b Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 2 Oct 2019 20:46:00 +0100 Subject: [PATCH] Implement exec command for running raw Python code --- commands/exec.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 commands/exec.py diff --git a/commands/exec.py b/commands/exec.py new file mode 100644 index 0000000..50080f1 --- /dev/null +++ b/commands/exec.py @@ -0,0 +1,16 @@ +import main + +class ExecCommand: + def __init__(self, *args): + self.exec(*args) + + def exec(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length): + if authed: + if length > 1: + info(str(exec(" ".join(spl[1:])))) + return + else: + incUsage("exec") + return + else: + incUsage(None)