Implement exec command for running raw Python code

This commit is contained in:
Mark Veidemanis 2019-10-02 20:46:00 +01:00
parent d35f96de87
commit 872d08be3e
1 changed files with 16 additions and 0 deletions

16
commands/exec.py Normal file
View File

@ -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)