mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
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:
parent
95ea2fb40c
commit
e12f6c747f
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user