From ddd6c560fe3db5dbe8f198eebc6d6f844ca22c11 Mon Sep 17 00:00:00 2001 From: L-ING Date: Wed, 27 Dec 2023 17:30:43 +0800 Subject: [PATCH] fix: preprocess remote_path for /dir --- modules/handlers/dir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/handlers/dir.py b/modules/handlers/dir.py index 5ca9ffd..fda00ca 100644 --- a/modules/handlers/dir.py +++ b/modules/handlers/dir.py @@ -34,7 +34,7 @@ async def dir_handler(event): await event.respond(f'Directory reset to default `{Dir.path}`') # /dir $remote_path else: - remote_path = cmd[1] + remote_path = cmd[1].strip().strip('*') if remote_path.startswith('/'): Dir.set_perm_path(remote_path) await event.respond(f'Directory set to `{Dir.path}`') @@ -44,7 +44,7 @@ async def dir_handler(event): elif len(cmd) == 3: sub_cmd = cmd[1] if sub_cmd == 'temp': - remote_path = cmd[2] + remote_path = cmd[2].strip().strip('*') if remote_path.startswith('/'): Dir.set_temp_path(remote_path) await event.respond(f'Temporary directory set to `{Dir.path}`')