Allowing nosound_video to be specified (#4090)

This commit is contained in:
Deer-Spangle
2023-04-14 21:03:03 +01:00
committed by GitHub
parent 7b1b33f805
commit 6e7423e894
3 changed files with 30 additions and 8 deletions

View File

@@ -640,7 +640,8 @@ class MessageMethods:
background: bool = None,
supports_streaming: bool = False,
schedule: 'hints.DateLike' = None,
comment_to: 'typing.Union[int, types.Message]' = None
comment_to: 'typing.Union[int, types.Message]' = None,
nosound_video: bool = None,
) -> 'types.Message':
"""
Sends a message to the specified user, chat or channel.
@@ -754,6 +755,15 @@ class MessageMethods:
This parameter takes precedence over ``reply_to``. If there is
no linked chat, `telethon.errors.sgIdInvalidError` is raised.
nosound_video (`bool`, optional):
Only applicable when sending a video file without an audio
track. If set to ``True``, the video will be displayed in
Telegram as a video. If set to ``False``, Telegram will attempt
to display the video as an animated gif. (It may still display
as a video due to other factors.) The value is ignored if set
on non-video files. This is set to ``True`` for albums, as gifs
cannot be sent in albums.
Returns
The sent `custom.Message <telethon.tl.custom.message.Message>`.
@@ -821,7 +831,8 @@ class MessageMethods:
buttons=buttons, clear_draft=clear_draft, silent=silent,
schedule=schedule, supports_streaming=supports_streaming,
formatting_entities=formatting_entities,
comment_to=comment_to, background=background
comment_to=comment_to, background=background,
nosound_video=nosound_video,
)
entity = await self.get_input_entity(entity)