mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-06 15:14:52 +00:00
allow file objects be passed to file_name arg of client.download_media
This commit is contained in:
parent
db80c72b08
commit
0694480a46
1 changed files with 1 additions and 1 deletions
|
|
@ -516,7 +516,7 @@ class Client:
|
||||||
# Make file_dir if it was specified
|
# Make file_dir if it was specified
|
||||||
os.makedirs(file_dir, exist_ok=True)
|
os.makedirs(file_dir, exist_ok=True)
|
||||||
|
|
||||||
if file_name is not None:
|
if isinstance(file_name, str) and file_name is not None:
|
||||||
os.makedirs(os.path.dirname(file_name), exist_ok=True)
|
os.makedirs(os.path.dirname(file_name), exist_ok=True)
|
||||||
|
|
||||||
if isinstance(media, types.MessageMediaDocument):
|
if isinstance(media, types.MessageMediaDocument):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue