Skip to content

Commit

Permalink
Merge branch 'master' of github.com:krypton-byte/neonize
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte committed May 23, 2024
2 parents 54461e6 + 15b6fbc commit b1b54ee
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 @@ -973,6 +973,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 @@ -988,9 +989,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 @@ -1011,6 +1010,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 @@ -1031,7 +1031,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 b1b54ee

Please sign in to comment.