Add os.path.abspath so .download saves to the current directory by default

This commit is contained in:
blank X 2020-10-29 20:01:36 +07:00
parent c838aefc58
commit 2411df9e81
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ async def upload(client, message):
@log_errors @log_errors
@public_log_errors @public_log_errors
async def download(client, message): async def download(client, message):
file = os.path.expanduser(' '.join(message.command[1:]) or './') file = os.path.abspath(os.path.expanduser(' '.join(message.command[1:]) or './'))
if os.path.isdir(file): if os.path.isdir(file):
file = os.path.join(file, '') file = os.path.join(file, '')
available_media = ("audio", "document", "photo", "sticker", "animation", "video", "voice", "video_note") available_media = ("audio", "document", "photo", "sticker", "animation", "video", "voice", "video_note")