mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-30 17:59:55 +03:00
thumb parameter
This commit is contained in:
parent
6b53d45ce2
commit
df6535c240
|
@ -603,6 +603,7 @@ class MessageMethods:
|
||||||
formatting_entities: typing.Optional[typing.List[types.TypeMessageEntity]] = None,
|
formatting_entities: typing.Optional[typing.List[types.TypeMessageEntity]] = None,
|
||||||
link_preview: bool = True,
|
link_preview: bool = True,
|
||||||
file: 'typing.Union[hints.FileLike, typing.Sequence[hints.FileLike]]' = None,
|
file: 'typing.Union[hints.FileLike, typing.Sequence[hints.FileLike]]' = None,
|
||||||
|
thumb: 'hints.FileLike' = None,
|
||||||
force_document: bool = False,
|
force_document: bool = False,
|
||||||
clear_draft: bool = False,
|
clear_draft: bool = False,
|
||||||
buttons: 'hints.MarkupLike' = None,
|
buttons: 'hints.MarkupLike' = None,
|
||||||
|
@ -664,6 +665,17 @@ class MessageMethods:
|
||||||
Sends a message with a file attached (e.g. a photo,
|
Sends a message with a file attached (e.g. a photo,
|
||||||
video, audio or document). The ``message`` may be empty.
|
video, audio or document). The ``message`` may be empty.
|
||||||
|
|
||||||
|
thumb (`str` | `bytes` | `file`, optional):
|
||||||
|
Optional JPEG thumbnail (for documents). **Telegram will
|
||||||
|
ignore this parameter** unless you pass a ``.jpg`` file!
|
||||||
|
The file must also be small in dimensions and in disk size.
|
||||||
|
Successful thumbnails were files below 20kB and 320x320px.
|
||||||
|
Width/height and dimensions/size ratios may be important.
|
||||||
|
For Telegram to accept a thumbnail, you must provide the
|
||||||
|
dimensions of the underlying media through ``attributes=``
|
||||||
|
with :tl:`DocumentAttributesVideo` or by installing the
|
||||||
|
optional ``hachoir`` dependency.
|
||||||
|
|
||||||
force_document (`bool`, optional):
|
force_document (`bool`, optional):
|
||||||
Whether to send the given file as a document or not.
|
Whether to send the given file as a document or not.
|
||||||
|
|
||||||
|
@ -772,7 +784,7 @@ class MessageMethods:
|
||||||
return await self.send_file(
|
return await self.send_file(
|
||||||
entity, file, caption=message, reply_to=reply_to,
|
entity, file, caption=message, reply_to=reply_to,
|
||||||
attributes=attributes, parse_mode=parse_mode,
|
attributes=attributes, parse_mode=parse_mode,
|
||||||
force_document=force_document,
|
force_document=force_document,thumb=thumb,
|
||||||
buttons=buttons, clear_draft=clear_draft, silent=silent,
|
buttons=buttons, clear_draft=clear_draft, silent=silent,
|
||||||
schedule=schedule, supports_streaming=supports_streaming,
|
schedule=schedule, supports_streaming=supports_streaming,
|
||||||
formatting_entities=formatting_entities,
|
formatting_entities=formatting_entities,
|
||||||
|
@ -986,6 +998,7 @@ class MessageMethods:
|
||||||
formatting_entities: typing.Optional[typing.List[types.TypeMessageEntity]] = None,
|
formatting_entities: typing.Optional[typing.List[types.TypeMessageEntity]] = None,
|
||||||
link_preview: bool = True,
|
link_preview: bool = True,
|
||||||
file: 'hints.FileLike' = None,
|
file: 'hints.FileLike' = None,
|
||||||
|
thumb: 'hints.FileLike' = None,
|
||||||
force_document: bool = False,
|
force_document: bool = False,
|
||||||
buttons: 'hints.MarkupLike' = None,
|
buttons: 'hints.MarkupLike' = None,
|
||||||
supports_streaming: bool = False,
|
supports_streaming: bool = False,
|
||||||
|
@ -1038,6 +1051,17 @@ class MessageMethods:
|
||||||
The file object that should replace the existing media
|
The file object that should replace the existing media
|
||||||
in the message.
|
in the message.
|
||||||
|
|
||||||
|
thumb (`str` | `bytes` | `file`, optional):
|
||||||
|
Optional JPEG thumbnail (for documents). **Telegram will
|
||||||
|
ignore this parameter** unless you pass a ``.jpg`` file!
|
||||||
|
The file must also be small in dimensions and in disk size.
|
||||||
|
Successful thumbnails were files below 20kB and 320x320px.
|
||||||
|
Width/height and dimensions/size ratios may be important.
|
||||||
|
For Telegram to accept a thumbnail, you must provide the
|
||||||
|
dimensions of the underlying media through ``attributes=``
|
||||||
|
with :tl:`DocumentAttributesVideo` or by installing the
|
||||||
|
optional ``hachoir`` dependency.
|
||||||
|
|
||||||
force_document (`bool`, optional):
|
force_document (`bool`, optional):
|
||||||
Whether to send the given file as a document or not.
|
Whether to send the given file as a document or not.
|
||||||
|
|
||||||
|
@ -1102,6 +1126,7 @@ class MessageMethods:
|
||||||
text, formatting_entities = await self._parse_message_text(text, parse_mode)
|
text, formatting_entities = await self._parse_message_text(text, parse_mode)
|
||||||
file_handle, media, image = await self._file_to_media(file,
|
file_handle, media, image = await self._file_to_media(file,
|
||||||
supports_streaming=supports_streaming,
|
supports_streaming=supports_streaming,
|
||||||
|
thumb=thumb,
|
||||||
attributes=attributes,
|
attributes=attributes,
|
||||||
force_document=force_document)
|
force_document=force_document)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user