Extend use of force_document to work on files

This allows .webp files to be sent as documents and not stickers.
This commit is contained in:
Lonami Exo 2020-07-26 13:03:59 +02:00
parent 95ea2fb40c
commit e12f6c747f
2 changed files with 3 additions and 2 deletions

View File

@ -766,7 +766,8 @@ class UploadMethods:
file=file_handle, file=file_handle,
mime_type=mime_type, mime_type=mime_type,
attributes=attributes, attributes=attributes,
thumb=thumb thumb=thumb,
force_file=force_document
) )
return file_handle, media, as_image return file_handle, media, as_image

View File

@ -483,7 +483,7 @@ def get_input_media(
supports_streaming=supports_streaming supports_streaming=supports_streaming
) )
return types.InputMediaUploadedDocument( return types.InputMediaUploadedDocument(
file=media, mime_type=mime, attributes=attrs) file=media, mime_type=mime, attributes=attrs, force_file=force_document)
if isinstance(media, types.MessageMediaGame): if isinstance(media, types.MessageMediaGame):
return types.InputMediaGame(id=types.InputGameID( return types.InputMediaGame(id=types.InputGameID(