
    N[i`$                         d dl Z d dlmZ d dlmZmZmZmZ d dlZd dlmZ d dlm	Z	 d dlm
Z
 d dlmZ d dlmZ d d	lmZ  G d
 d      Zy)    N)datetime)UnionBinaryIOOptionalCallable)StopTransmission)raw)types)utils)FilePartMissing)FileTypec                       e Zd Z	 	 	 	 	 	 	 	 	 	 ddddeeef   deeef   dededeeef   d	ed
edededed   de	de
ded   fdZy)SendVideoNoteNselfzpyrogram.Clientchat_id
video_notedurationlengththumbdisable_notificationreply_to_message_idschedule_dateprotect_contentreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyprogressprogress_argsreturnztypes.Messagec                 J  K   d}	 t        |t              rt        j                  j	                  |      r| j                  |       d{   }| j                  |||       d{   }t        j                  j                  | j                  |      xs d||t        j                  j                  d|||      g      }nt        j                  |t        j                        }n| j                  |       d{   }| j                  |||       d{   }t        j                  j                  | j                  |j                        xs d||t        j                  j                  d|||      g      }	 	 | j!                  t        j"                  j$                  j'                  | j)                  |       d{   ||xs d|| j+                         t        j,                  |      |	|
r|
j/                  |        d{   ndd	             d{   }|j0                  D ]  }t        |t        j                  j2                  t        j                  j4                  t        j                  j6                  f      s[t        j8                  j;                  | |j<                  |j>                  D ci c]  }|j@                  | c}|jB                  D ci c]  }|j@                  | c}t        t        j                  j6                        	       d{   c S  	 7 7 7 67 7 u7 37 "c c}w c c}w 7 )# tD        $ r;}| j                  ||j@                  |jF                  
       d{  7   Y d}~bd}~ww xY w# tH        $ r Y yw xY ww)a$  Send video messages.

        .. include:: /_includes/usable-by/users-bots.rst

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.
                For your personal cloud (Saved Messages) you can simply use "me" or "self".
                For a contact that exists in your Telegram address book you can use his phone number (str).

            video_note (``str`` | ``BinaryIO``):
                Video note to send.
                Pass a file_id as string to send a video note that exists on the Telegram servers,
                pass a file path as string to upload a new video note that exists on your local machine, or
                pass a binary file-like object with its attribute ".name" set for in-memory uploads.
                Sending video notes by a URL is currently unsupported.

            duration (``int``, *optional*):
                Duration of sent video in seconds.

            length (``int``, *optional*):
                Video width and height.

            thumb (``str`` | ``BinaryIO``, *optional*):
                Thumbnail of the video sent.
                The thumbnail should be in JPEG format and less than 200 KB in size.
                A thumbnail's width and height should not exceed 320 pixels.
                Thumbnails can't be reused and can be only uploaded as a new file.

            disable_notification (``bool``, *optional*):
                Sends the message silently.
                Users will receive a notification with no sound.

            reply_to_message_id (``int``, *optional*):
                If the message is a reply, ID of the original message

            schedule_date (:py:obj:`~datetime.datetime`, *optional*):
                Date when the message will be automatically sent.

            protect_content (``bool``, *optional*):
                Protects the contents of the sent message from forwarding and saving.

            reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
                Additional interface options. An object for an inline keyboard, custom reply keyboard,
                instructions to remove reply keyboard or to force a reply from the user.

            progress (``Callable``, *optional*):
                Pass a callback function to view the file transmission progress.
                The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
                detailed description) and will be called back each time a new file chunk has been successfully
                transmitted.

            progress_args (``tuple``, *optional*):
                Extra custom arguments for the progress callback function.
                You can pass anything you need to be available in the progress callback scope; for example, a Message
                object or a Client instance in order to edit the message with the updated progress status.

        Other Parameters:
            current (``int``):
                The amount of bytes transmitted so far.

            total (``int``):
                The total size of the file.

            *args (``tuple``, *optional*):
                Extra custom arguments as defined in the ``progress_args`` parameter.
                You can either keep ``*args`` or add every single extra argument in your function signature.

        Returns:
            :obj:`~pyrogram.types.Message` | ``None``: On success, the sent video note message is returned, otherwise,
            in case the upload is deliberately stopped with :meth:`~pyrogram.Client.stop_transmission`, None is
            returned.

        Example:
            .. code-block:: python

                # Send video note by uploading from local file
                await app.send_video_note("me", "video_note.mp4")

                # Set video note length
                await app.send_video_note("me", "video_note.mp4", length=25)
        N)r   r   z	video/mp4T)round_messager   wh)	mime_typefiler   
attributes )	peermediasilentreply_to_msg_id	random_idr   
noforwardsr   message)is_scheduled)file_id	file_part)%
isinstancestrospathisfile	save_filer	   r
   InputMediaUploadedDocumentguess_mime_typeDocumentAttributeVideor   get_input_media_from_file_idr   
VIDEO_NOTEnameinvoke	functionsmessages	SendMediaresolve_peerrnd_iddatetime_to_timestampwriteupdatesUpdateNewMessageUpdateNewChannelMessageUpdateNewScheduledMessageMessage_parser,   usersidchatsr   valuer   )r   r   r   r   r   r   r   r   r   r   r   r   r   r#   r'   ries                     \/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/messages/send_video_note.pysend_video_notezSendVideoNote.send_video_note!   s%    L B	*c*77>>*-"&.."77E!%
X]j!kkDII@@"&"6"6z"B"Qk!#II<<.2)1"("(	 = $	 A E ">>z8K^K^_E"nnU33!^^JYf^gg		<<"22:??CR{		88*.%-$$	 9  	 =  "kk..88'+'8'8'A!A"'#7#?4,?&*kkm*/*E*Em*T'6KW|/A/A$/G)G)G]a$& 9 
 A  YY 	%a#))*D*D*-))*K*K*-))*M*M*O P */)=)= $aii23'' :Qq :23'' :Qq :-7399;^;^-_	 *> * $ 		% E 8k" 4g& "B *H, !; :$ ' Y..TWWPQPWPW.XXXY   		s  N#AN 	L,
N %L/&BN <L2=N L5A'N AM L8AM L;	M L>M !A&N 3N ;MN M3.N !M"N 'N#(N /N 2N 5N 8M ;M >M N 	N+NNNN NN 	N N#N  N#)
r      NNNNNNN )__name__
__module____qualname__r   intr1   r   boolr   r   tupler   rR   rT       rQ   r   r       s    
 &*%)#'"& $ !!%jjsCxj #x-(j 	j
 j S(]#j #j !j  j j 
j" #j$ %j& 
/	"'jr[   r   )r2   r   typingr   r   r   r   pyrogramr   r	   r
   r   pyrogram.errorsr   pyrogram.file_idr   r   rT   r[   rQ   <module>r`      s4   & 
  6 6  %    + %k kr[   