
    i                          d 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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  G d de
          ZdS )zNThis module contains the classes that represent Telegram InlineQueryResultGif.    N)Sequence)TYPE_CHECKING)InlineKeyboardMarkup)InlineQueryResult)MessageEntity)parse_sequence_argto_timedelta)get_timedelta_value)DEFAULT_NONE)JSONDictODVInput
TimePeriod)InlineQueryResultType)InputMessageContentc            !           e Zd ZdZdZdddddddedddfdddededededz  d	edz  d
edz  dedz  dedz  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  f fdZedeej        z  dz  fd            Z xZS )InlineQueryResultGifa  
    Represents a link to an animated GIF file. By default, this animated GIF file will be sent by
    the user with optional caption. Alternatively, you can use :attr:`input_message_content` to
    send a message with the specified content instead of the animation.

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

    .. versionchanged:: 20.5
      |removed_thumb_wildcard_note|

    Args:
        id (:obj:`str`): Unique identifier for this result,
            :tg-const:`telegram.InlineQueryResult.MIN_ID_LENGTH`-
            :tg-const:`telegram.InlineQueryResult.MAX_ID_LENGTH` Bytes.
        gif_url (:obj:`str`): A valid URL for the GIF file.
        gif_width (:obj:`int`, optional): Width of the GIF.
        gif_height (:obj:`int`, optional): Height of the GIF.
        gif_duration (:obj:`int` | :class:`datetime.timedelta`, optional): Duration of the GIF
            in seconds.

            .. versionchanged:: v22.2
                |time-period-input|
        thumbnail_url (:obj:`str`): URL of the static (JPEG or GIF) or animated (MPEG4)
            thumbnail for the result.

            .. versionadded:: 20.2

            .. versionchanged:: 20.5
              |thumbnail_url_mandatory|

        thumbnail_mime_type (:obj:`str`, optional): MIME type of the thumbnail, must be one of
            ``'image/jpeg'``, ``'image/gif'``, or ``'video/mp4'``. Defaults to ``'image/jpeg'``.

            .. versionadded:: 20.2
        title (:obj:`str`, optional): Title for the result.
        caption (:obj:`str`, optional): Caption of the GIF file 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|

        reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): Inline keyboard attached
            to the message.
        input_message_content (:class:`telegram.InputMessageContent`, optional): Content of the
            message to be sent instead of the GIF animation.
        show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med|

            .. versionadded:: 21.3

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InlineQueryResultType.GIF`.
        id (:obj:`str`): Unique identifier for this result,
            :tg-const:`telegram.InlineQueryResult.MIN_ID_LENGTH`-
            :tg-const:`telegram.InlineQueryResult.MAX_ID_LENGTH` Bytes.
        gif_url (:obj:`str`): A valid URL for the GIF file.
        gif_width (:obj:`int`): Optional. Width of the GIF.
        gif_height (:obj:`int`): Optional. Height of the GIF.
        gif_duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Duration of the GIF
            in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        thumbnail_url (:obj:`str`): URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail
            for the result.

            .. versionadded:: 20.2
        thumbnail_mime_type (:obj:`str`): Optional. MIME type of the thumbnail, must be one of
            ``'image/jpeg'``, ``'image/gif'``, or ``'video/mp4'``. Defaults to ``'image/jpeg'``.

            .. versionadded:: 20.2
        title (:obj:`str`): Optional. Title for the result.
        caption (:obj:`str`): Optional. Caption of the GIF file 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|
        reply_markup (:class:`telegram.InlineKeyboardMarkup`): Optional. Inline keyboard attached
            to the message.
        input_message_content (:class:`telegram.InputMessageContent`): Optional. Content of the
            message to be sent instead of the GIF animation.
        show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med|

            .. versionadded:: 21.3

    )_gif_durationcaptioncaption_entities
gif_heightgif_url	gif_widthinput_message_content
parse_modereply_markupshow_caption_above_mediathumbnail_mime_typethumbnail_urltitleN
api_kwargsidr   r   r   r   r   r   r   r   zInputMessageContent | Nonegif_durationr   r   r   r   r!   c                   t                                          t          j        ||           |                                 5  || _        || _        || _        || _        t          |
          | _
        || _        || _        || _        t          |          | _        || _        |	| _        || _        || _        d d d            d S # 1 swxY w Y   d S )Nr    )super__init__r   GIF	_unfrozenr   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   )selfr"   r   r   r   r   r   r   r   r   r#   r   r   r   r   r!   	__class__s                   e/Users/shanyulin/my-agent/.venv/lib/python3.11/site-packages/telegram/_inline/inlinequeryresultgif.pyr&   zInlineQueryResultGif.__init__   s%   ( 	.2B:NNN^^ 	R 	R 'DL&3D *3DN*4DO7CL7Q7QD%*DJ'.DL-7DO?QRb?c?cD!=IDEZD&3FD$9QD)	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	Rs   A6CCCreturnc                 .    t          | j        d          S )Nr#   )	attribute)r
   r   )r)   s    r+   r#   z!InlineQueryResultGif.gif_duration   s    "4#5PPPP    )__name__
__module____qualname____doc__	__slots__r   strintr   r   r   r   r   boolr   r&   propertydtm	timedeltar#   __classcell__)r*   s   @r+   r   r   &   s       \ \|I* !%!% "48>B*.$0;?*.04$R" '+#$R $R $R$R $R 	$R
 :$R $J$R Tz$R t$R +T1$R  <$R !4'$R SM$R #=1D8$R !4Z$R #'+$R" tO#$R $R $R $R $R $RL QcCM1D8 Q Q Q XQ Q Q Q Qr/   r   )r3   datetimer9   collections.abcr   typingr   %telegram._inline.inlinekeyboardmarkupr   "telegram._inline.inlinequeryresultr   telegram._messageentityr   telegram._utils.argumentparsingr   r	   telegram._utils.datetimer
   telegram._utils.defaultvaluer   telegram._utils.typesr   r   r   telegram.constantsr   telegramr   r    r/   r+   <module>rI      sC  & U T     $ $ $ $ $ $             F F F F F F @ @ @ @ @ @ 1 1 1 1 1 1 L L L L L L L L 8 8 8 8 8 8 5 5 5 5 5 5 @ @ @ @ @ @ @ @ @ @ 4 4 4 4 4 4 -,,,,,,WQ WQ WQ WQ WQ, WQ WQ WQ WQ WQr/   