Skip to content

Commit

Permalink
Plugins: gdrive: don't use custom file name if it's None (adekmaulana#31
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rzlamrr authored Sep 2, 2021
1 parent 007bf3c commit 8f20a6b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bot/plugins/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,13 @@ def prog_func(current: int, total: int) -> None:

last_update_time = now

file_path = download_path / file_name
file_path = await ctx.bot.client.download_media(msg,
file_name=file_path,
progress=prog_func) # type: ignore
if file_name is None:
file_path = await ctx.bot.client.download_media(msg, progress=prog_func)
else:
file_path = f"{download_path}/{file_name}"
file_path = await ctx.bot.client.download_media(msg,
file_name=file_path,
progress=prog_func) # type: ignore

if file_path is not None:
return AsyncPath(file_path)
Expand Down

0 comments on commit 8f20a6b

Please sign in to comment.