diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 34820205..4547429d 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1884,7 +1884,9 @@ class Client: video_note (``str``): Video note to send. - Pass a file path as string to send a video note that exists on your local machine. + Pass a file_id as string to send a video note that exists on the Telegram servers, or + pass a file path as string to upload a new video note that exists on your local machine. + Sending video notes by a URL is currently unsupported. duration (``int``, optional): Duration of sent video in seconds. @@ -1911,40 +1913,71 @@ class Client: The size of the file. Returns: - On success, the sent Message is returned. + On success, the sent :obj:`Message ` is returned. Raises: :class:`Error ` """ - file = self.save_file(video_note, progress=progress) + file = None + + if os.path.exists(video_note): + file = self.save_file(video_note, progress=progress) + media = types.InputMediaUploadedDocument( + mime_type=mimetypes.types_map[".mp4"], + file=file, + attributes=[ + types.DocumentAttributeVideo( + round_message=True, + duration=duration, + w=length, + h=length + ) + ] + ) + else: + try: + decoded = utils.decode(video_note) + fmt = " 24 else "