From c0212a7b104c8cf03a67cd7e685f13401a50f7dd Mon Sep 17 00:00:00 2001 From: Eric Blundell Date: Tue, 20 Mar 2018 08:20:03 -0500 Subject: [PATCH] Correct default file_dir value behaviour --- pyrogram/client/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 6c8ee1b5..9955dd77 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -2622,7 +2622,7 @@ class Client: def download_media(self, message: types.Message, file_name: str = None, - file_dir: str = 'downloads', + file_dir: str = None, block: bool = True, progress: callable = None ): @@ -2670,6 +2670,9 @@ class Client: if file_name is not None and file_dir is not None: raise ValueError('file_name and file_dir may not be specified together.') + if file_name is None and file_dir is None: + file_dir = 'downloads' + if isinstance(message, (types.Message, types.Photo)): done = Event() path = [None]