mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Correct default file_dir value behaviour
This commit is contained in:
parent
19854a5d4f
commit
c0212a7b10
@ -2622,7 +2622,7 @@ class Client:
|
|||||||
def download_media(self,
|
def download_media(self,
|
||||||
message: types.Message,
|
message: types.Message,
|
||||||
file_name: str = None,
|
file_name: str = None,
|
||||||
file_dir: str = 'downloads',
|
file_dir: str = None,
|
||||||
block: bool = True,
|
block: bool = True,
|
||||||
progress: callable = None
|
progress: callable = None
|
||||||
):
|
):
|
||||||
@ -2670,6 +2670,9 @@ class Client:
|
|||||||
if file_name is not None and file_dir is not None:
|
if file_name is not None and file_dir is not None:
|
||||||
raise ValueError('file_name and file_dir may not be specified together.')
|
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)):
|
if isinstance(message, (types.Message, types.Photo)):
|
||||||
done = Event()
|
done = Event()
|
||||||
path = [None]
|
path = [None]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user