Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte authored May 15, 2024
1 parent c380489 commit 15b6fbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neonize/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ def build_document_message(
caption: Optional[str] = None,
title: Optional[str] = None,
filename: Optional[str] = None,
mimetype: Optional[str] = None,
quoted: Optional[neonize_proto.Message] = None,
):
io = BytesIO(get_bytes_from_name_or_url(file))
Expand All @@ -987,9 +988,7 @@ def build_document_message(
fileLength=upload.FileLength,
fileSha256=upload.FileSHA256,
mediaKey=upload.MediaKey,
mimetype=magic.from_buffer(buff, mime=True).replace(
"application", "document"
),
mimetype=mimetype or magic.from_buffer(buff, mime=True),
title=title,
fileName=filename,
contextInfo=ContextInfo(
Expand All @@ -1010,6 +1009,7 @@ def send_document(
caption: Optional[str] = None,
title: Optional[str] = None,
filename: Optional[str] = None,
mimetype: Optional[str] = None,
quoted: Optional[neonize_proto.Message] = None,
) -> SendResponse:
"""Sends a document to the specified recipient.
Expand All @@ -1030,7 +1030,7 @@ def send_document(
:rtype: SendResponse
"""
return self.send_message(
to, self.build_document_message(file, caption, title, filename, quoted)
to, self.build_document_message(file, caption, title, filename, mimetype, quoted)
)

def send_contact(
Expand Down

0 comments on commit 15b6fbc

Please sign in to comment.