
    'i                        U d Z ddlZddlmZ ddlmZmZ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 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mZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z) ddl*m+Z+ erddl&m,Z, eez  ez  ez  ez  Z-ee.d<    G d de      Z/ G d de      Z0 G d de0      Z1 G d de0      Z2 G d d e/      Z3 G d! d"e/      Z4 G d# d$e/      Z5 G d% d&e/      Z6 G d' d(e/      Z7y))z+Base class for Telegram InputMedia Objects.    N)Sequence)TYPE_CHECKINGFinal	TypeAlias)	constants)	Animation)Audio)Document)	InputFile)	PhotoSize)Video)MessageEntity)TelegramObject)enum)parse_sequence_argto_timedelta)get_timedelta_value)DEFAULT_NONEparse_file_input)JSONDictODVInput
TimePeriod)InputMediaType)	FileInput	MediaTypec                        e Zd ZdZdZddefdddedeez  dedz  dee	   dz  d	e
e   d
edz  f fdZedddeez  dz  fd       Z xZS )
InputMediaa  
    Base class for Telegram InputMedia Objects.

    .. versionchanged:: 20.0
        Added arguments and attributes :attr:`type`, :attr:`media`, :attr:`caption`,
            :attr:`caption_entities`, :paramref:`parse_mode`.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    Args:
        media_type (:obj:`str`): Type of media that the instance represents.
        media (:obj:`str` | :class:`~telegram.InputFile`): File to send.
            |fileinputnopath|
        caption (:obj:`str`, optional): Caption of the media to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities
            parsing.
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|

        parse_mode (:obj:`str`, optional): |parse_mode|

    Attributes:
        type (:obj:`str`): Type of the input media.
        media (:obj:`str` | :class:`telegram.InputFile`): Media to send.
        caption (:obj:`str`): Optional. Caption of the media to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities
            parsing.
        parse_mode (:obj:`str`): Optional. |parse_mode|
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|

    )captioncaption_entitiesmedia
parse_modetypeN
api_kwargs
media_typer!   r   r    r"   r%   c                    t         |   |       t        j                  t        j
                  ||      | _        || _        || _        t        |      | _
        || _        | j                          y Nr$   )super__init__r   
get_memberr   r   r#   r!   r   r   r    r"   _freeze)selfr&   r!   r   r    r"   r%   	__class__s          d/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/telegram/_files/inputmedia.pyr*   zInputMedia.__init__Z   s[     	J/)A)A:zZ	&+
#*;MN^;_)3    	thumbnailFileInput | Nonereturnc                 &    | t        | dd      S | S )NTattach
local_moder   )r1   s    r/   _parse_thumbnail_inputz!InputMedia._parse_thumbnail_inputm   s'     $ YtE	
 	
r0   )__name__
__module____qualname____doc__	__slots__r   strr   r   r   r   r   r*   staticmethodr8   __classcell__r.   s   @r/   r   r   0   s    %N OI #;?$0 '+ Y t	
 #=1D8 SM tO& 
*< 
ySWAW 
 
r0   r   c                        e Zd ZU dZej
                  j                  Zee   e	d<   	 ej
                  j                  Z
ee   e	d<   	 dZdddedeez  d	edz  f fd
Z xZS )InputPaidMediaah  
    Base class for Telegram InputPaidMedia Objects. Currently, it can be one of:

    * :class:`telegram.InputPaidMediaPhoto`
    * :class:`telegram.InputPaidMediaVideo`

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    .. versionadded:: 21.4

    Args:
        type (:obj:`str`): Type of media that the instance represents.
        media (:obj:`str` | :class:`~telegram.InputFile`): File
            to send. |fileinputnopath|

    Attributes:
        type (:obj:`str`): Type of the input media.
        media (:obj:`str` | :class:`telegram.InputFile`): Media to send.
    PHOTOVIDEO)r!   r#   Nr$   r#   r!   r%   c                    t         |   |       t        j                  t        j
                  ||      | _        || _        | j                          y r(   )	r)   r*   r   r+   r   InputPaidMediaTyper#   r!   r,   )r-   r#   r!   r%   r.   s       r/   r*   zInputPaidMedia.__init__   s?     	J/)E)EtTR	&+
r0   )r9   r:   r;   r<   r   rG   rD   r   r>   __annotations__rE   r=   r   r   r*   r@   rA   s   @r/   rC   rC   x   s|    ( "44::E5::>!44::E5::>!I '+ Y
 tO r0   rC   c                   <     e Zd ZdZdZdddddedz  f fdZ xZS )	InputPaidMediaPhotoa  The paid media to send is a photo.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    .. versionadded:: 21.4

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.PhotoSize`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.PhotoSize` object to send.

    Attributes:
        type (:obj:`str`): Type of the media, always
            :tg-const:`telegram.constants.InputPaidMediaType.PHOTO`.
        media (:obj:`str` | :class:`telegram.InputFile`): Photo to send.
     Nr$   r!   FileInput | PhotoSizer%   c                    t        |t        dd      }t        |   t        j
                  ||       | j                          y NTr5   )r#   r!   r%   )r   r   r)   r*   rC   rD   r,   )r-   r!   r%   r.   s      r/   r*   zInputPaidMediaPhoto.__init__   s8     !	$4Pn22%JWr0   )r9   r:   r;   r<   r=   r   r*   r@   rA   s   @r/   rJ   rJ      s4    " I '+	& tO	 r0   rJ   c                        e Zd ZdZdZ	 	 	 	 	 	 	 dddddddd	edz  d
edz  dedz  dedz  dddedz  dedz  f fdZ	e
deej                  z  dz  fd       Z xZS )InputPaidMediaVideoa
  
    The paid media to send is a video.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    .. versionadded:: 21.4

    Note:
        *  When using a :class:`telegram.Video` for the :attr:`media` attribute, it will take the
           width, height and duration from that video, unless otherwise specified with the optional
           arguments.
        *  :paramref:`thumbnail` will be ignored for small video files, for which Telegram can
           easily generate thumbnails. However, this behaviour is undocumented and might be
           changed by Telegram.

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.Video`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.Video` object to send.
        thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): |thumbdocstringnopath|
        cover (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): Cover for the video in the message. |fileinputnopath|

            .. versionchanged:: 21.11
        start_timestamp (:obj:`int`, optional): Start timestamp for the video in the message

            .. versionchanged:: 21.11
        width (:obj:`int`, optional): Video width.
        height (:obj:`int`, optional): Video height.
        duration (:obj:`int` | :class:`datetime.timedelta`, optional): Video duration in seconds.

            .. versionchanged:: v22.2
                |time-period-input|
        supports_streaming (:obj:`bool`, optional): Pass :obj:`True`, if the uploaded video is
            suitable for streaming.

    Attributes:
        type (:obj:`str`): Type of the media, always
            :tg-const:`telegram.constants.InputPaidMediaType.VIDEO`.
        media (:obj:`str` | :class:`telegram.InputFile`): Video to send.
        thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|
        cover (:class:`telegram.InputFile`): Optional. Cover for the video in the message.
            |fileinputnopath|

            .. versionchanged:: 21.11
        start_timestamp (:obj:`int`): Optional. Start timestamp for the video in the message

            .. versionchanged:: 21.11
        width (:obj:`int`): Optional. Video width.
        height (:obj:`int`): Optional. Video height.
        duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Video duration in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        supports_streaming (:obj:`bool`): Optional. :obj:`True`, if the uploaded video is
            suitable for streaming.
    )	_durationcoverheightstart_timestampsupports_streamingr1   widthNr$   r!   FileInput | Videor1   r2   rV   rS   durationrU   rR   rT   r%   c	                    t        |t              r=||n|j                  }||n|j                  }||n|j                  }|j
                  }nt        |dd      }t        
| !  t        j                  ||	       | j                         5  t        j                  |      | _        || _        || _        t        |      | _        || _        |rt        |dd      nd | _        || _        d d d        y # 1 sw Y   y xY wrN   )
isinstancer   rV   rS   rQ   file_idr   r)   r*   rC   rE   	_unfrozenr   r8   r1   r   rU   rR   rT   )r-   r!   r1   rV   rS   rX   rU   rR   rT   r%   r.   s             r/   r*   zInputPaidMediaVideo.__init__  s     eU#".EEKKE%1Vu||F#+#7xU__HMME %U4DIEn22%JW^^ 		?5?5V5VW`5aDN%*DJ&,DK3?3IDN3ED#IN tETX J 0?D 		? 		? 		?s   AC44C=r3   c                 0    t        | j                  d      S NrX   )	attributer   rQ   r-   s    r/   rX   zInputPaidMediaVideo.duration*      "4>>ZHHr0   )NNNNNNN)r9   r:   r;   r<   r=   intr   boolr   r*   propertydtm	timedeltarX   r@   rA   s   @r/   rP   rP      s    9vI )- !&**.$(&*!? '+!?"!? &!? Tz	!?
 d
!? t#!? !4K!? "!? t!? tO!?F I#-4 I Ir0   rP   c                        e Zd ZdZdZdeddddddddf
dddddedz  dee   d	edz  d
edz  de	dz  de
e   dz  dedz  dedz  dddedz  dedz  f fdZedeej"                  z  dz  fd       Z xZS )InputMediaAnimationaO  Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

    Note:
        When using a :class:`telegram.Animation` for the :attr:`media` attribute, it will take the
        width, height and duration from that animation, unless otherwise specified with the
        optional arguments.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    .. versionchanged:: 20.5
      |removed_thumb_note|

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.Animation`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.Animation` object to send.

            .. versionchanged:: 13.2
               Accept :obj:`bytes` as input.
        filename (:obj:`str`, optional): Custom file name for the animation, when uploading a
            new file. Convenience parameter, useful e.g. when sending files generated by the
            :obj:`tempfile` module.

            .. versionadded:: 13.1
        caption (:obj:`str`, optional): Caption of the animation to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`, optional): |parse_mode|
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|

        width (:obj:`int`, optional): Animation width.
        height (:obj:`int`, optional): Animation height.
        duration (:obj:`int` | :class:`datetime.timedelta`, optional): Animation duration
            in seconds.

            .. versionchanged:: v22.2
                |time-period-input|
        has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the animation needs to be covered
            with a spoiler animation.

            .. versionadded:: 20.0
        thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): |thumbdocstringnopath|

            .. versionadded:: 20.2
        show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med|

            .. versionadded:: 21.3

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.ANIMATION`.
        media (:obj:`str` | :class:`telegram.InputFile`): Animation to send.
        caption (:obj:`str`): Optional. Caption of the animation to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`): Optional. The parse mode to use for text formatting.
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|
        width (:obj:`int`): Optional. Animation width.
        height (:obj:`int`): Optional. Animation height.
        duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Animation duration
            in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the animation is covered with a
            spoiler animation.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|

            .. versionadded:: 20.2
        show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med|

            .. versionadded:: 21.3
    )rQ   has_spoilerrS   show_caption_above_mediar1   rV   Nr$   r!   zFileInput | Animationr   r"   rV   rS   rX   r    filenamerj   r1   r2   rk   r%   c                   t        |t              r=||j                  n|}||j                  n|}||n|j                  }|j
                  }nt        ||dd      }t        | !  t        j                  |||||       | j                         5  | j                  |
      | _        || _        || _        t        |      | _        |	| _        || _        d d d        y # 1 sw Y   y xY wNTrl   r6   r7   r$   )rZ   r   rV   rS   rQ   r[   r   r)   r*   r   	ANIMATIONr\   r8   r1   r   rj   rk   )r-   r!   r   r"   rV   rS   rX   r    rl   rj   r1   rk   r%   r.   s                r/   r*   zInputMediaAnimation.__init__  s      eY'#(=EKKeE%+^U\\F#+#7xU__HMME %UXdW[\E$$! 	 	
 ^^ 	R595P5PQZ5[DN%*DJ&,DK3?3IDN,7D9QD)	R 	R 	Rs   ACC&r3   c                 0    t        | j                  d      S r^   r`   ra   s    r/   rX   zInputMediaAnimation.duration  rb   r0   )r9   r:   r;   r<   r=   r   r>   r   rc   r   r   r   rd   r   r*   re   rf   rg   rX   r@   rA   s   @r/   ri   ri   /  s    RhI #$0 !&*;?##'(,04(R '+(R&(R t(R SM	(R
 Tz(R d
(R t#(R #=1D8(R *(R D[(R &(R #'+(R tO(RT I#-4 I Ir0   ri   c                        e Zd ZdZdZdeddddfdddddedz  dee   d	ee	   dz  d
edz  de
dz  de
dz  dedz  f fdZ xZS )InputMediaPhotoa9	  Represents a photo to be sent.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.PhotoSize`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.PhotoSize` object to send.

            .. versionchanged:: 13.2
               Accept :obj:`bytes` as input.
        filename (:obj:`str`, optional): Custom file name for the photo, when uploading a
            new file. Convenience parameter, useful e.g. when sending files generated by the
            :obj:`tempfile` module.

            .. versionadded:: 13.1
        caption (:obj:`str`, optional ): Caption of the photo to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
            entities parsing.
        parse_mode (:obj:`str`, optional): |parse_mode|
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|
        has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the photo needs to be covered
            with a spoiler animation.

            .. versionadded:: 20.0
        show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med|

            .. versionadded:: 21.3

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.PHOTO`.
        media (:obj:`str` | :class:`telegram.InputFile`): Photo to send.
        caption (:obj:`str`): Optional. Caption of the photo to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`): Optional. |parse_mode|
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|
        has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the photo is covered with a
            spoiler animation.

            .. versionadded:: 20.0
        show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med|

            .. versionadded:: 21.3
    )rj   rk   Nr$   r!   rL   r   r"   r    rl   rj   rk   r%   c                    t        |t        |dd      }t        	|   t        j
                  |||||       | j                         5  || _        || _        d d d        y # 1 sw Y   y xY wrn   )	r   r   r)   r*   r   rD   r\   rj   rk   )
r-   r!   r   r"   r    rl   rj   rk   r%   r.   s
            r/   r*   zInputMediaPhoto.__init__  sw     !	HT^bc  ! 	 	
 ^^ 	R,7D9QD)	R 	R 	Rs   	A!!A*)r9   r:   r;   r<   r=   r   r>   r   r   r   rd   r   r*   r@   rA   s   @r/   rs   rs     s    4lI #$0;?##'04R '+R&R tR SM	R
 #=1D8R *R D[R #'+R tOR Rr0   rs   c            !       
    e Zd ZdZdZdddddedddddddfdddddedz  dedz  d	edz  d
edz  de	dz  de
e   dee   dz  dedz  de	dz  ddde	dz  dddedz  dedz  f fdZedeej"                  z  dz  fd       Z xZS )InputMediaVideoa  Represents a video to be sent.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    Note:
        *  When using a :class:`telegram.Video` for the :attr:`media` attribute, it will take the
           width, height and duration from that video, unless otherwise specified with the optional
           arguments.
        *  :paramref:`thumbnail` will be ignored for small video files, for which Telegram can
            easily generate thumbnails. However, this behaviour is undocumented and might be
            changed by Telegram.

    .. versionchanged:: 20.5
      |removed_thumb_note|

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.Video`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.Video` object to send.

            .. versionchanged:: 13.2
               Accept :obj:`bytes` as input.
        filename (:obj:`str`, optional): Custom file name for the video, when uploading a
            new file. Convenience parameter, useful e.g. when sending files generated by the
            :obj:`tempfile` module.

            .. versionadded:: 13.1
        caption (:obj:`str`, optional): Caption of the video to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
            entities parsing.
        parse_mode (:obj:`str`, optional): |parse_mode|
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|

        width (:obj:`int`, optional): Video width.
        height (:obj:`int`, optional): Video height.
        duration (:obj:`int` | :class:`datetime.timedelta`, optional): Video duration in seconds.

            .. versionchanged:: v22.2
                |time-period-input|
        supports_streaming (:obj:`bool`, optional): Pass :obj:`True`, if the uploaded video is
            suitable for streaming.
        has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the video needs to be covered
            with a spoiler animation.

            .. versionadded:: 20.0
        thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): |thumbdocstringnopath|

            .. versionadded:: 20.2
        cover (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): Cover for the video in the message. |fileinputnopath|

            .. versionchanged:: 21.11
        start_timestamp (:obj:`int`, optional): Start timestamp for the video in the message

            .. versionchanged:: 21.11
        show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med|

            .. versionadded:: 21.3

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.VIDEO`.
        media (:obj:`str` | :class:`telegram.InputFile`): Video file to send.
        caption (:obj:`str`): Optional. Caption of the video to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`): Optional. |parse_mode|
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|
        width (:obj:`int`): Optional. Video width.
        height (:obj:`int`): Optional. Video height.
        duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Video duration in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        supports_streaming (:obj:`bool`): Optional. :obj:`True`, if the uploaded video is
            suitable for streaming.
        has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the video is covered with a
            spoiler animation.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|

            .. versionadded:: 20.2
        show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med|

            .. versionadded:: 21.3
        cover (:class:`telegram.InputFile`): Optional. Cover for the video in the message.
            |fileinputnopath|

            .. versionchanged:: 21.11
        start_timestamp (:obj:`int`): Optional. Start timestamp for the video in the message

            .. versionchanged:: 21.11
    )	rQ   rR   rj   rS   rk   rT   rU   r1   rV   Nr$   r!   rW   r   rV   rS   rX   rU   r"   r    rl   rj   r1   r2   rk   rR   rT   r%   c                   t        |t              r=||n|j                  }||n|j                  }||n|j                  }|j
                  }nt        ||	dd      }t        | !  t        j                  |||||       | j                         5  || _        || _        t        |      | _        | j                  |      | _        || _        |
| _        || _        |rt        |dd      nd | _        || _        d d d        y # 1 sw Y   y xY w)NTro   r$   r5   )rZ   r   rV   rS   rQ   r[   r   r)   r*   r   rE   r\   r   r8   r1   rU   rj   rk   rR   rT   )r-   r!   r   rV   rS   rX   rU   r"   r    rl   rj   r1   rk   rR   rT   r%   r.   s                   r/   r*   zInputMediaVideo.__init__  s   & eU#".EEKKE%1Vu||F#+#7xU__HMME %UXdW[\E  ! 	 	
 ^^ 	?%*DJ&,DK3?3IDN595P5PQZ5[DN3ED#,7D9QD)IN tETX J 0?D 	? 	? 	?s   A(DDr3   c                 0    t        | j                  d      S r^   r`   ra   s    r/   rX   zInputMediaVideo.duration  rb   r0   )r9   r:   r;   r<   r=   r   r>   rc   r   rd   r   r   r   r   r*   re   rf   rg   rX   r@   rA   s   @r/   rv   rv     sA   eN
I # !&**.$0;?##'(,04$(&*0?" '+#0?"0? t0? Tz	0?
 d
0? t#0? !4K0? SM0? #=1D80? *0? D[0? &0? #'+0? "0? t0?" tO#0?d I#-4 I Ir0   rv   c                        e Zd ZdZdZdeddddddfdddddedz  dee   d	edz  d
edz  dedz  de	e
   dz  dedz  dddedz  f fdZedeej                   z  dz  fd       Z xZS )InputMediaAudioa  Represents an audio file to be treated as music to be sent.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    Note:
        When using a :class:`telegram.Audio` for the :attr:`media` attribute, it will take the
        duration, performer and title from that video, unless otherwise specified with the
        optional arguments.

    .. versionchanged:: 20.5
      |removed_thumb_note|

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path` | :class:`telegram.Audio`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.Audio` object to send.

            .. versionchanged:: 13.2
               Accept :obj:`bytes` as input.
        filename (:obj:`str`, optional): Custom file name for the audio, when uploading a
            new file. Convenience parameter, useful e.g. when sending files generated by the
            :obj:`tempfile` module.

            .. versionadded:: 13.1
        caption (:obj:`str`, optional): Caption of the audio to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
            entities parsing.
        parse_mode (:obj:`str`, optional): |parse_mode|
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|

        duration (:obj:`int` | :class:`datetime.timedelta`, optional): Duration of the audio
            in seconds as defined by the sender.

            .. versionchanged:: v22.2
                |time-period-input|
        performer (:obj:`str`, optional): Performer of the audio as defined by the sender or by
            audio tags.
        title (:obj:`str`, optional): Title of the audio as defined by the sender or by audio tags.
        thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): |thumbdocstringnopath|

            .. versionadded:: 20.2

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.AUDIO`.
        media (:obj:`str` | :class:`telegram.InputFile`): Audio file to send.
        caption (:obj:`str`): Optional. Caption of the audio to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`): Optional. |parse_mode|
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|
        duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Duration of the audio
            in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        performer (:obj:`str`): Optional. Performer of the audio as defined by the sender or by
            audio tags.
        title (:obj:`str`): Optional. Title of the audio as defined by the sender or by audio tags.
        thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|

            .. versionadded:: 20.2

    )rQ   	performerr1   titleNr$   r!   zFileInput | Audior   r"   rX   r{   r|   r    rl   r1   r2   r%   c
                   t        |t              r=||n|j                  }||j                  n|}||j                  n|}|j
                  }nt        ||dd      }t        | !  t        j                  |||||
       | j                         5  | j                  |	      | _        t        |      | _        || _        || _        d d d        y # 1 sw Y   y xY wrn   )rZ   r	   rQ   r{   r|   r[   r   r)   r*   r   AUDIOr\   r8   r1   r   )r-   r!   r   r"   rX   r{   r|   r    rl   r1   r%   r.   s              r/   r*   zInputMediaAudio.__init__  s     eU##+#7xU__H+4+<)I#(=EKKeEMME %UXdW[\E  ! 	 	
 ^^ 	3595P5PQZ5[DN3?3IDN%*DJ)2DN		3 	3 	3s   5CCr3   c                 0    t        | j                  d      S r^   r`   ra   s    r/   rX   zInputMediaAudio.duration2  rb   r0   )r9   r:   r;   r<   r=   r   r>   r   r   r   r   r   r*   re   rc   rf   rg   rX   r@   rA   s   @r/   rz   rz     s    GR AI
 #$0&* $ ;?#(,$3 '+$3"$3 t$3 SM	$3
 t#$3 :$3 Tz$3 #=1D8$3 *$3 &$3 tO$3L I#-4 I Ir0   rz   c                        e Zd ZdZdZdeddddfdddddedz  dee   d	edz  d
e	e
   dz  dedz  dddedz  f fdZ xZS )InputMediaDocumentaq
  Represents a general file to be sent.

    .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`

    .. versionchanged:: 20.5
      |removed_thumb_note|

    Args:
        media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes`             | :class:`pathlib.Path` | :class:`telegram.Document`): File to send. |fileinputnopath|
            Lastly you can pass an existing :class:`telegram.Document` object to send.

            .. versionchanged:: 13.2
               Accept :obj:`bytes` as input.
        filename (:obj:`str`, optional): Custom file name for the document, when uploading a
            new file. Convenience parameter, useful e.g. when sending files generated by the
            :obj:`tempfile` module.

            .. versionadded:: 13.1
        caption (:obj:`str`, optional): Caption of the document to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
            entities parsing.
        parse_mode (:obj:`str`, optional): |parse_mode|
        caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities|

            .. versionchanged:: 20.0
                |sequenceclassargs|

        disable_content_type_detection (:obj:`bool`, optional): Disables automatic server-side
            content type detection for files uploaded using multipart/form-data. Always
            :obj:`True`, if the document is sent as part of an album.
        thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,                 optional): |thumbdocstringnopath|

            .. versionadded:: 20.2

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.DOCUMENT`.
        media (:obj:`str` | :class:`telegram.InputFile`): File to send.
        caption (:obj:`str`): Optional. Caption of the document to be sent,
            0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
            after entities parsing.
        parse_mode (:obj:`str`): Optional. |parse_mode|
        caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr|

            .. versionchanged:: 20.0

                * |tupleclassattrs|
                * |alwaystuple|
        disable_content_type_detection (:obj:`bool`): Optional. Disables automatic server-side
            content type detection for files uploaded using multipart/form-data. Always
            :obj:`True`, if the document is sent as part of an album.
        thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|

            .. versionadded:: 20.2
    )disable_content_type_detectionr1   Nr$   r!   zFileInput | Documentr   r"   r   r    rl   r1   r2   r%   c                    t        |t        |dd      }t        	|   t        j
                  |||||       | j                         5  | j                  |      | _        || _	        d d d        y # 1 sw Y   y xY wrn   )
r   r
   r)   r*   r   DOCUMENTr\   r8   r1   r   )
r-   r!   r   r"   r   r    rl   r1   r%   r.   s
            r/   r*   zInputMediaDocument.__init__s  s     !8D]ab##! 	 	
 ^^ 	^595P5PQZ5[DN?]D/	^ 	^ 	^s   	A00A9)r9   r:   r;   r<   r=   r   r>   r   rd   r   r   r   r*   r@   rA   s   @r/   r   r   7  s    7r @I
 #$06:;?#(,^ '+^%^ t^ SM	^
 )-t^ #=1D8^ *^ &^ tO^ ^r0   r   )8r<   datetimerf   collections.abcr   typingr   r   r   telegramr   telegram._files.animationr   telegram._files.audior	   telegram._files.documentr
   telegram._files.inputfiler   telegram._files.photosizer   telegram._files.videor   telegram._messageentityr   telegram._telegramobjectr   telegram._utilsr   telegram._utils.argumentparsingr   r   telegram._utils.datetimer   telegram._utils.defaultvaluer   telegram._utils.filesr   telegram._utils.typesr   r   r   telegram.constantsr   r   r   rH   r   rC   rJ   rP   ri   rs   rv   rz   r   rK   r0   r/   <module>r      s   & 2  $ 2 2  / ' - / / ' 1 3   L 8 5 2 @ @ -/ 5(83i?%G	9 GE
 E
P'^ 'T. >kI. kI\JI* JIZVRj VRrhIj hIVtIj tInV^ V^r0   