mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Fix file extension
This commit is contained in:
parent
834fff88da
commit
64ebf979e5
@ -311,7 +311,8 @@ class Client:
|
||||
if not file_name:
|
||||
file_name = "doc_{}{}".format(
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user