mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Fix file extension
This commit is contained in:
parent
834fff88da
commit
64ebf979e5
@ -311,7 +311,8 @@ class Client:
|
|||||||
if not file_name:
|
if not file_name:
|
||||||
file_name = "doc_{}{}".format(
|
file_name = "doc_{}{}".format(
|
||||||
datetime.fromtimestamp(document.date).strftime("%Y-%m-%d_%H-%M-%S"),
|
datetime.fromtimestamp(document.date).strftime("%Y-%m-%d_%H-%M-%S"),
|
||||||
mimetypes.guess_extension(document.mime_type) or ".unknown"
|
".txt" if document.mime_type == "text/plain" else
|
||||||
|
mimetypes.guess_extension(document.mime_type) if document.mime_type else ".unknown"
|
||||||
)
|
)
|
||||||
|
|
||||||
for i in document.attributes:
|
for i in document.attributes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user