mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-06 17:03:04 +02:00
Update filemon.py
This commit is contained in:
+9
-5
@@ -95,10 +95,13 @@ def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
|
||||
return "x: command not authorized in group chat"
|
||||
|
||||
if enable_runShellCmd:
|
||||
if message.startswith("x: "):
|
||||
command = message.removeprefix("x: ").strip()
|
||||
elif message.startswith("x:"):
|
||||
command = message.removeprefix("x:").strip()
|
||||
if message.lower().startswith("x:"):
|
||||
# Remove 'x:' (case-insensitive)
|
||||
command = message[2:]
|
||||
# If there's a space after 'x:', remove it
|
||||
if command.startswith(" "):
|
||||
command = command[1:]
|
||||
command = command.strip()
|
||||
else:
|
||||
return "x: invalid command format"
|
||||
|
||||
@@ -113,4 +116,5 @@ def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
|
||||
logger.warning(f"FileMon: Error running shell command: {e}")
|
||||
return "x: command error"
|
||||
else:
|
||||
return "x: command is disabled"
|
||||
logger.debug("FileMon: x: command is disabled by no enable_runShellCmd")
|
||||
return "x: command is disabled"
|
||||
|
||||
Reference in New Issue
Block a user