mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
Cleanup Locale system, remove legacy Locale API, add command help handling, misc
This commit is contained in:
4
ModWinDog/System/System.py
Normal file → Executable file
4
ModWinDog/System/System.py
Normal file → Executable file
@ -15,7 +15,7 @@ from re import compile as re_compile
|
||||
|
||||
def cExec(context:EventContext, data:InputMessageData) -> None:
|
||||
if not (len(data.command.tokens) >= 2 and data.command.tokens[1].lower() in ExecAllowed):
|
||||
return SendMessage(context, {"Text": choice(Locale.__('eval'))})
|
||||
return SendMessage(context, {"Text": "This feature is not implemented [Security Issue]."})
|
||||
command = data.command.tokens[1].lower()
|
||||
output = subprocess.run(
|
||||
("sh", "-c", f"export PATH=$PATH:/usr/games; {command}"),
|
||||
@ -26,6 +26,6 @@ def cExec(context:EventContext, data:InputMessageData) -> None:
|
||||
text_plain=text, text_html=f"<pre>{html_escape(text)}</pre>"))
|
||||
|
||||
RegisterModule(name="System", endpoints=[
|
||||
SafeNamespace(names=["exec"], handler=cExec),
|
||||
SafeNamespace(names=["exec"], handler=cExec, body=True),
|
||||
])
|
||||
|
||||
|
Reference in New Issue
Block a user