
    iE                         S SK r S SKrS SKrS SKJr  S SKJrJrJrJrJ	r	  S SK
r
S SK
JrJrJrJrJr  S SKJr  S SKJr  \ R(                  " \5      r " S S5      rg)	    N)datetime)BinaryIOCallableListOptionalUnion)StopTransmissionenumsrawtypesutils)FilePartMissing)FileTypec            J       8   \ rS rSr                                S0SSS\\\4   S\\\4   S\S	\S
\	S   S\
S   S\S\S\S\S\\\4   S\S\S\S\S\S\SSS\S\S\S\S\S \S!S"S#\S$   S%\S&\S'\S(\\\4   S)\S*\S+\
S   S,\S-\	S.   4HS/ jjrSrg)1SendAnimation    N selfzpyrogram.Clientchat_id	animationcaptionunsave
parse_modezenums.ParseModecaption_entitiesztypes.MessageEntityhas_spoilerdurationwidthheightthumb	file_namedisable_notificationmessage_thread_iddirect_messages_topic_id	effect_idshow_caption_above_mediareply_parametersztypes.ReplyParametersschedule_daterepeat_periodprotect_contentbusiness_connection_idallow_paid_broadcastpaid_message_star_countsuggested_post_parametersztypes.SuggestedPostParametersreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyprogressprogress_argsreply_to_message_idreply_to_chat_idreply_to_story_id
quote_textquote_entitiesquote_offsetreturnztypes.Messagec#                 @  #    [        USLUSLUSLU SLU!SLU"SL45      (       a  Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        U b  [        R                  S5        U!b  [        R                  S5        U"b  [        R                  S5        [        R                  " UUUU UU!U"S9nSn# [        U[        5      (       Gap  [        R                  R                  U5      (       a  U R                  U5      I Sh  vN nU R                  UUUS	9I Sh  vN n#[        R                  R                  U R                  U5      =(       d    S
U#UU[        R                  R                  SUU	U
S9[        R                  R                  U=(       d    [        R                  R!                  U5      S9[        R                  R#                  5       /S9n$GOJ[$        R&                  " SU5      (       a   [        R                  R)                  UUS9n$GO[*        R,                  " U[.        R0                  US9n$OU R                  U5      I Sh  vN nU R                  UUUS	9I Sh  vN n#[        R                  R                  U R                  U=(       d    UR2                  5      =(       d    S
U#UU[        R                  R                  SUU	U
S9[        R                  R                  U=(       d    UR2                  S9[        R                  R#                  5       /S9n$  U R5                  U5      I Sh  vN n%U R7                  [        R8                  R:                  R<                  " SU%U$U=(       d    SU[*        R>                  " U UUU5      I Sh  vN U RA                  5       [*        RB                  " U5      UUUU(       a  URE                  U 5      I Sh  vN OSUUU(       a  URE                  5       OSS.[*        RF                  " XXV5      I Sh  vN D6US9I Sh  vN n&U&RH                   GH  n'[        U'[        R                  RJ                  [        R                  RL                  [        R                  RN                  [        R                  RP                  45      (       d  M{  [        RR                  RU                  U U'RV                  U&RX                   V's0 s H  n'U'RZ                  U'_M     sn'U&R\                   V's0 s H  n'U'RZ                  U'_M     sn'[        W'[        R                  RN                  5      [_        U'SS5      S9I Sh  vN n(U(       a  U(R`                  (       a  [*        R,                  " U(R`                  Rb                  [.        R0                  5      RZ                  n)U R7                  [        R8                  R:                  Re                  U)SS95      I Sh  vN   U(s  $    GM   GN  GN GN GN GN GNz GN7 GN GNs  sn'f s  sn'f  N N4! [f         a8  n*U R                  UU#RZ                  U*Rh                  S9I Sh  vN     Sn*A*NiSn*A*ff = f! [j         a     gf = f7f)ag  Send animation files (animation or H.264/MPEG-4 AVC video without sound).

.. 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).

    animation (``str`` | ``BinaryIO``):
        Animation to send.
        Pass a file_id as string to send an animation that exists on the Telegram servers,
        pass an HTTP URL as a string for Telegram to get an animation from the Internet,
        pass a file path as string to upload a new animation that exists on your local machine, or
        pass a binary file-like object with its attribute ".name" set for in-memory uploads.

    caption (``str``, *optional*):
        Animation caption, 0-1024 characters.

    unsave (``bool``, *optional*):
        By default, the server will save into your own collection any new animation you send.
        Pass True to automatically unsave the sent animation. Defaults to False.

    parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
        List of special entities that appear in the caption, which can be specified instead of *parse_mode*.

    has_spoiler (``bool``, *optional*):
        Pass True if the animation needs to be covered with a spoiler animation.

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

    width (``int``, *optional*):
        Animation width.

    height (``int``, *optional*):
        Animation height.

    thumb (``str`` | ``BinaryIO``, *optional*):
        Thumbnail of the animation file 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.

    file_name (``str``, *optional*):
        File name of the animation sent.
        Defaults to file's path basename.

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

    message_thread_id (``int``, *optional*):
        Unique identifier for the target message thread (topic) of the forum.
        For forums only.

    direct_messages_topic_id (``int``, *optional*):
        Unique identifier of the topic in a channel direct messages chat administered by the current user.
        For directs only only.

    effect_id (``int``, *optional*):
        Unique identifier of the message effect.
        For private chats only.

    show_caption_above_media (``bool``, *optional*):
        Pass True, if the caption must be shown above the message media.

    reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*):
        Describes reply parameters for the message that is being sent.

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

    repeat_period (``int``, *optional*):
        Period after which the message will be sent again in seconds.

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

    business_connection_id (``str``, *optional*):
        Unique identifier of the business connection on behalf of which the message will be sent.

    allow_paid_broadcast (``bool``, *optional*):
        If True, you will be allowed to send up to 1000 messages per second.
        Ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message.
        The relevant Stars will be withdrawn from the bot's balance.
        For bots only.

    paid_message_star_count (``int``, *optional*):
        The number of Telegram Stars the user agreed to pay to send the messages.

    suggested_post_parameters (:obj:`~pyrogram.types.SuggestedPostParameters`, *optional*):
        Information about the suggested post.

    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 animation 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 animation by uploading from local file
        await app.send_animation("me", "animation.gif")

        # Add caption to the animation
        await app.send_animation("me", "animation.gif", caption="animation caption")

        # Unsave the animation once is sent
        await app.send_animation("me", "animation.gif", unsave=True)

        # Keep track of the progress while uploading
        async def progress(current, total):
            print(f"{current * 100 / total:.1f}%")

        await app.send_animation("me", "animation.gif", progress=progress)
Nzj`reply_to_message_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zg`reply_to_chat_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zh`reply_to_story_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.za`quote_text` is deprecated and will be removed in future updates. Use `reply_parameters` instead.ze`quote_entities` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zc`quote_offset` is deprecated and will be removed in future updates. Use `reply_parameters` instead.)
message_idr   story_idquotequote_parse_moder5   quote_position)r/   r0   z	video/mp4T)supports_streamingr   wh)r    )	mime_typefiler   spoiler
attributesz
^https?://)urlrC   )r   )peermediasilentinvert_mediareply_to	random_idr'   schedule_repeat_period
noforwardsallow_paid_floodskipr.   effectallow_paid_starssuggested_post)r*   connection_id)is_scheduledr*   )idr   )file_id	file_partr   )6anylogwarningr   ReplyParameters
isinstancestrospathisfile	save_filer   InputMediaUploadedDocumentguess_mime_typeDocumentAttributeVideoDocumentAttributeFilenamebasenameDocumentAttributeAnimatedrematchInputMediaDocumentExternalr   get_input_media_from_file_idr   	ANIMATIONnameresolve_peerinvoke	functionsmessages	SendMediaget_reply_tornd_iddatetime_to_timestampwriteparse_text_entitiesupdatesUpdateNewMessageUpdateNewChannelMessageUpdateNewScheduledMessageUpdateBotNewBusinessMessageMessage_parsemessageusersrT   chatsgetattrr   rU   SaveGifr   valuer	   )+r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   rB   rG   rF   rir~   document_ides+                                              U/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/messages/send_animation.pysend_animationSendAnimation.send_animation!   s    ~ #4/ ,!-$&d*D(	
 	
 #. A  +} !,~ %w ){ 'y  %44.(* !+-+  g	)S))77>>),,"&.."77E!%	H\i!jjDII@@"&"6"6y"A"P[!# +II<<37)1"'"(	 =   II??)JrWYW^W^WgWghqWr?sII??A	$ A E  XXlI66II@@% + A E
 ">>y(J\J\juvE"nnU33!^^IXe^ff		<<"2293N	O^S^'		88/3%-#$	 9  		;;iFaS\SaSa;b		;;=	  = " 3+!%!2!27!;;D"kk..88 !%"'#7#?4)A+0+=+= $ 0 1 8	, & '+kkm*/*E*Em*T3@'61EKW|/A/A$/G)G)G]a#,-DPi+D+J+J+Los'( %*$=$=dZ$jj), 0F/ *  A8 YY%a#))*D*D*-))*K*K*-))*M*M*-))*O*O*Q R R -2MM,@,@ $aii23'' :'Qq' :23'' :'Qq' :-7399;^;^-_7>q/SW7X -A - 'G  &'*;*;.3.P.P$+$5$5$=$=$,$6$6/" #%" !,
 '+kk#--2H2H2P2PT_hl2P2m&n n n#*N+ '? [ 8j2 4f( <& *H k+F !; :' !o- ' X..DGGqww.WWWX4   		sK  CZAZ  X !Z 9X#:D2Z ,X&-Z X)B<Z Y	 X,AY	 5X/6AY	 ;X2"<;Y	 7X58Y	 X8Y	 	BZ 3Z X;Z *Y 7Z 8Y9BZ YZ ZZ #Z &Z )Z ,Y	 /Y	 2Y	 5Y	 8Y	 ;Z Z 	
Z(Z;Y><ZZ ZZ 
ZZZZ)  FNNNr   r   r   NNNNNNNNNNNNNNNNNr   NNNNNN)__name__
__module____qualname____firstlineno__r   intr\   r   boolr   r   r   r   tupler   __static_attributes__r       r   r   r       sQ   
 268< &*%)!%(,)-48"&! $&*%)'+EI !!#',0!%6: SZZsCxZ h'Z 	Z
 Z ./Z 45Z Z Z Z Z S(]#Z Z #Z Z  #&!Z" #Z$ #'%Z& 2'Z(  )Z* +Z, -Z. !$/Z0 #1Z2 "%3Z4 $C5Z6 
7ZB CZD EZH !IZJ  S/KZL MZN OZP 23QZR SZT 
/	"UZ Zr   r   )loggingr]   rg   r   typingr   r   r   r   r   pyrogramr	   r
   r   r   r   pyrogram.errorsr   pyrogram.file_idr   	getLoggerr   rX   r   r   r   r   <module>r      sD   &  	 	  < <  ? ? + %![ [r   