
    ՟fU                        d Z ddlmZmZ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 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- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z;m<Z< erddl=m>Z>  G d de5      Z? G d  d!e5      Z@ G d" d#e5      ZAy$)%z>This modules contains objects that represents Telegram Replies    )TYPE_CHECKINGOptionalSequenceTupleUnion)Chat)Dice)	Animation)Audio)Contact)Document)Location)	PhotoSize)Sticker)Venue)Video)	VideoNote)Voice)Game)GiveawayGiveawayWinners)LinkPreviewOptions)MessageEntity)MessageOrigin)PaidMediaInfo)Invoice)Poll)Story)TelegramObject)parse_sequence_arg)DEFAULT_NONE)JSONDictODVInput)Botc            5           e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$dddedee   dee   dee	   d	ee
   d
ee   dee   deee      dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   dee   f2 fdZ e!	 d%dee   d ed!   d"ed    f fd#       Z" xZ#S )&ExternalReplyInfoae  
    This object contains information about a message that is being replied to, which may
    come from another chat or forum topic.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`origin` is equal.

    .. versionadded:: 20.8

    Args:
        origin (:class:`telegram.MessageOrigin`): Origin of the message replied to by the given
            message.
        chat (:class:`telegram.Chat`, optional): Chat the original message belongs to. Available
            only if the chat is a supergroup or a channel.
        message_id (:obj:`int`, optional): Unique message identifier inside the original chat.
            Available only if the original chat is a supergroup or a channel.
        link_preview_options (:class:`telegram.LinkPreviewOptions`, optional): Options used for
            link preview generation for the original message, if it is a text message
        animation (:class:`telegram.Animation`, optional): Message is an animation, information
            about the animation.
        audio (:class:`telegram.Audio`, optional): Message is an audio file, information about the
            file.
        document (:class:`telegram.Document`, optional): Message is a general file, information
            about the file.
        photo (Sequence[:class:`telegram.PhotoSize`], optional): Message is a photo, available
            sizes of the photo.
        sticker (:class:`telegram.Sticker`, optional): Message is a sticker, information about the
            sticker.
        story (:class:`telegram.Story`, optional): Message is a forwarded story.
        video (:class:`telegram.Video`, optional): Message is a video, information about the video.
        video_note (:class:`telegram.VideoNote`, optional): Message is a `video note
            <https://telegram.org/blog/video-messages-and-telescope>`_, information about the video
            message.
        voice (:class:`telegram.Voice`, optional): Message is a voice message, information about
            the file.
        has_media_spoiler (:obj:`bool`, optional): :obj:`True`, if the message media is covered by
            a spoiler animation.
        contact (:class:`telegram.Contact`, optional): Message is a shared contact, information
            about the contact.
        dice (:class:`telegram.Dice`, optional): Message is a dice with random value.
        game (:Class:`telegram.Game`. optional): Message is a game, information about the game.
            :ref:`More about games >> <games-tree>`.
        giveaway (:class:`telegram.Giveaway`, optional): Message is a scheduled giveaway,
            information about the giveaway.
        giveaway_winners (:class:`telegram.GiveawayWinners`, optional): A giveaway with public
            winners was completed.
        invoice (:class:`telegram.Invoice`, optional): Message is an invoice for a payment,
            information about the invoice. :ref:`More about payments >> <payments-tree>`.
        location (:class:`telegram.Location`, optional): Message is a shared location, information
            about the location.
        poll (:class:`telegram.Poll`, optional): Message is a native poll, information about the
            poll.
        venue (:class:`telegram.Venue`, optional): Message is a venue, information about the venue.
        paid_media (:class:`telegram.PaidMedia`, optional): Message contains paid media;
            information about the paid media.

            .. versionadded:: 21.4

    Attributes:
        origin (:class:`telegram.MessageOrigin`): Origin of the message replied to by the given
            message.
        chat (:class:`telegram.Chat`): Optional. Chat the original message belongs to. Available
            only if the chat is a supergroup or a channel.
        message_id (:obj:`int`): Optional. Unique message identifier inside the original chat.
            Available only if the original chat is a supergroup or a channel.
        link_preview_options (:class:`telegram.LinkPreviewOptions`): Optional. Options used for
            link preview generation for the original message, if it is a text message.
        animation (:class:`telegram.Animation`): Optional. Message is an animation, information
            about the animation.
        audio (:class:`telegram.Audio`): Optional. Message is an audio file, information about the
            file.
        document (:class:`telegram.Document`): Optional. Message is a general file, information
            about the file.
        photo (Tuple[:class:`telegram.PhotoSize`]): Optional. Message is a photo, available sizes
            of the photo.
        sticker (:class:`telegram.Sticker`): Optional. Message is a sticker, information about the
            sticker.
        story (:class:`telegram.Story`): Optional. Message is a forwarded story.
        video (:class:`telegram.Video`): Optional. Message is a video, information about the video.
        video_note (:class:`telegram.VideoNote`): Optional. Message is a `video note
            <https://telegram.org/blog/video-messages-and-telescope>`_, information about the video
            message.
        voice (:class:`telegram.Voice`): Optional. Message is a voice message, information about
            the file.
        has_media_spoiler (:obj:`bool`): Optional. :obj:`True`, if the message media is covered by
            a spoiler animation.
        contact (:class:`telegram.Contact`): Optional. Message is a shared contact, information
            about the contact.
        dice (:class:`telegram.Dice`): Optional. Message is a dice with random value.
        game (:Class:`telegram.Game`): Optional. Message is a game, information about the game.
            :ref:`More about games >> <games-tree>`.
        giveaway (:class:`telegram.Giveaway`): Optional. Message is a scheduled giveaway,
            information about the giveaway.
        giveaway_winners (:class:`telegram.GiveawayWinners`): Optional. A giveaway with public
            winners was completed.
        invoice (:class:`telegram.Invoice`): Optional. Message is an invoice for a payment,
            information about the invoice. :ref:`More about payments >> <payments-tree>`.
        location (:class:`telegram.Location`): Optional. Message is a shared location, information
            about the location.
        poll (:class:`telegram.Poll`): Optional. Message is a native poll, information about the
            poll.
        venue (:class:`telegram.Venue`): Optional. Message is a venue, information about the venue.
        paid_media (:class:`telegram.PaidMedia`): Optional. Message contains paid media;
            information about the paid media.

            .. versionadded:: 21.4
    )	animationaudiochatcontactdicedocumentgamegiveawaygiveaway_winnershas_media_spoilerinvoicelink_preview_optionslocation
message_idorigin
paid_mediaphotopollstickerstoryvenuevideo
video_notevoiceN
api_kwargsr5   r)   r4   r2   r'   r(   r,   r7   r9   r:   r<   r=   r>   r0   r*   r+   r-   r.   r/   r1   r3   r8   r;   r6   r@   c                   t         |   |       || _        || _        || _        || _        || _        || _        || _        t        |      | _
        |	| _        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | j                  f| _        | j9                          y Nr?   )super__init__r5   r)   r4   r2   r'   r(   r,   r    r7   r9   r:   r<   r=   r>   r0   r*   r+   r-   r.   r/   r1   r3   r8   r;   r6   	_id_attrs_freeze)selfr5   r)   r4   r2   r'   r(   r,   r7   r9   r:   r<   r=   r>   r0   r*   r+   r-   r.   r/   r1   r3   r8   r;   r6   r@   	__class__s                             J/var/www/cvtools/html/venv/lib/python3.12/site-packages/telegram/_reply.pyrD   zExternalReplyInfo.__init__   s    : 	J/%+$(	)3BV!.7&+
,46H6O
*1&+
&+
/9&+
1B*1$(	$(	,4;K*1,4$(	&+
3=++    databotr$   returnc                 @   | j                  |      }|yt        j                  |j                  d      |      |d<   t	        j                  |j                  d      |      |d<   t        j                  |j                  d      |      |d<   t        j                  |j                  d      |      |d<   t        j                  |j                  d      |      |d<   t        j                  |j                  d      |      |d<   t        t        j                  |j                  d      |            |d<   t        j                  |j                  d	      |      |d	<   t        j                  |j                  d
      |      |d
<   t        j                  |j                  d      |      |d<   t        j                  |j                  d      |      |d<   t!        j                  |j                  d      |      |d<   t#        j                  |j                  d      |      |d<   t%        j                  |j                  d      |      |d<   t'        j                  |j                  d      |      |d<   t)        j                  |j                  d      |      |d<   t+        j                  |j                  d      |      |d<   t-        j                  |j                  d      |      |d<   t/        j                  |j                  d      |      |d<   t1        j                  |j                  d      |      |d<   t3        j                  |j                  d      |      |d<   t5        j                  |j                  d      |      |d<   t6        | 	  ||      S ),See :meth:`telegram.TelegramObject.de_json`.Nr5   r)   r2   r'   r(   r,   r7   r9   r:   r<   r=   r>   r*   r+   r-   r.   r/   r1   r3   r8   r;   r6   rK   rL   )_parse_datar   de_jsongetr   r   r
   r   r   tupler   de_listr   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   rC   clsrK   rL   rH   s      rI   rR   zExternalReplyInfo.de_json   s   
 t$<&..txx/A3GX||DHHV$4c:V'9'A'AHH+,c(
#$ &--dhh{.CSI[dhhw&7=W#++DHHZ,@#FZi//0A3GHW!//$((9*=sCYdhhw&7=Wdhhw&7=W&..txx/EsK\dhhw&7=W!//$((9*=sCY||DHHV$4c:V||DHHV$4c:V#++DHHZ,@#FZ#2#:#:488DV;WY\#] !//$((9*=sCY#++DHHZ,@#FZ||DHHV$4c:Vdhhw&7=W*22488L3I3O\wDc22rJ   )NNNNNNNNNNNNNNNNNNNNNNNN)$__name__
__module____qualname____doc__	__slots__r   r   r   intr   r
   r   r   r   r   r   r   r   r   r   boolr   r	   r   r   r   r   r   r   r   r   r"   rD   classmethodrR   __classcell__rH   s   @rI   r&   r&   5   s   jXI<  $$(=A)-!%'+/3%)!%!%*.!%,0%)##'+6:%)'+#!%.23:6 *.7:: tn: SM	:
 ''9:: I&: : 8$: +,: '": : : Y': : $D>:  '"!:" tn#:$ tn%:& 8$':( #?3):* '"+:, 8$-:. tn/:0 1:2 ]+3:6 X&7:x >B"3H%"3,4UO"3	%	&"3 "3rJ   r&   c                        e Zd ZdZdZ	 	 ddddededeee	      dee
   d	ee   f
 fd
Ze	 ddee   ded   ded    f fd       Z xZS )	TextQuotea  
    This object contains information about the quoted part of a message that is replied to
    by the given message.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`text` and :attr:`position` are equal.

    .. versionadded:: 20.8

    Args:
        text (:obj:`str`): Text of the quoted part of a message that is replied to by the given
            message.
        position (:obj:`int`): Approximate quote position in the original message in UTF-16 code
            units as specified by the sender.
        entities (Sequence[:class:`telegram.MessageEntity`], optional): Special entities that
            appear
            in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and
            custom_emoji entities are kept in quotes.
        is_manual (:obj:`bool`, optional): :obj:`True`, if the quote was chosen manually by the
            message sender. Otherwise, the quote was added automatically by the server.

    Attributes:
        text (:obj:`str`): Text of the quoted part of a message that is replied to by the given
            message.
        position (:obj:`int`): Approximate quote position in the original message in UTF-16 code
            units as specified by the sender.
        entities (Tuple[:class:`telegram.MessageEntity`]): Optional. Special entities that appear
            in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and
            custom_emoji entities are kept in quotes.
        is_manual (:obj:`bool`): Optional. :obj:`True`, if the quote was chosen manually by the
            message sender. Otherwise, the quote was added automatically by the server.
    )entities	is_manualpositiontextNr?   rh   rg   re   rf   r@   c                    t         |   |       || _        || _        t	        |      | _        || _        | j                  | j                  f| _        | j                          y rB   )	rC   rD   rh   rg   r    re   rf   rE   rF   )rG   rh   rg   re   rf   r@   rH   s         rI   rD   zTextQuote.__init__H  s[     	J/	%=OPX=Y)2 IIMM

 	rJ   rK   rL   r$   rM   c                     | j                  |      }|yt        t        j                  |j	                  d      |            |d<   t
        |   ||      S )rO   Nre   rP   rQ   rT   r   rU   rS   rC   rR   rV   s      rI   rR   zTextQuote.de_json_  sS    
 t$< !6!6txx
7KS!QRZwDc22rJ   )NNrX   )rY   rZ   r[   r\   r]   strr^   r   r   r   r_   r"   rD   r`   rR   ra   rb   s   @rI   rd   rd     s    BI 7;$( *.  8M23	
 D> X&. >B3H%3,4UO3	+	3 3rJ   rd   c                        e Zd ZdZdZdededdfdddedeeee	f      de
e   dee	   d	e
e	   d
eee      dee   dee   f fdZe	 ddee   ded   ded    f fd       Z xZS )ReplyParametersa'  
    Describes reply parameters for the message that is being sent.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`message_id` is equal.

    .. versionadded:: 20.8

    Args:
        message_id (:obj:`int`): Identifier of the message that will be replied to in the current
            chat, or in the chat :paramref:`chat_id` if it is specified.
        chat_id (:obj:`int` | :obj:`str`, optional): If the message to be replied to is from a
            different chat, |chat_id_channel|
            Not supported for messages sent on behalf of a business account.
        allow_sending_without_reply (:obj:`bool`, optional): |allow_sending_without_reply| Can be
            used only for replies in the same chat and forum topic.
        quote (:obj:`str`, optional): Quoted part of the message to be replied to; 0-1024
            characters after entities parsing. The quote must be an exact substring of the message
            to be replied to, including bold, italic, underline, strikethrough, spoiler, and
            custom_emoji entities. The message will fail to send if the quote isn't found in the
            original message.
        quote_parse_mode (:obj:`str`, optional): Mode for parsing entities in the quote. See
            :wiki:`formatting options <Code-snippets#message-formatting-bold-italic-code->` for
            more details.
        quote_entities (Sequence[:class:`telegram.MessageEntity`], optional): A JSON-serialized
            list
            of special entities that appear in the quote. It can be specified instead of
            :paramref:`quote_parse_mode`.
        quote_position (:obj:`int`, optional): Position of the quote in the original message in
            UTF-16 code units.

    Attributes:
        message_id (:obj:`int`): Identifier of the message that will be replied to in the current
            chat, or in the chat :paramref:`chat_id` if it is specified.
        chat_id (:obj:`int` | :obj:`str`): Optional. If the message to be replied to is from a
            different chat, |chat_id_channel|
            Not supported for messages sent on behalf of a business account.
        allow_sending_without_reply (:obj:`bool`): Optional. |allow_sending_without_reply| Can be
            used only for replies in the same chat and forum topic.
        quote (:obj:`str`): Optional. Quoted part of the message to be replied to; 0-1024
            characters after entities parsing. The quote must be an exact substring of the message
            to be replied to, including bold, italic, underline, strikethrough, spoiler, and
            custom_emoji entities. The message will fail to send if the quote isn't found in the
            original message.
        quote_parse_mode (:obj:`str`): Optional. Mode for parsing entities in the quote. See
            :wiki:`formatting options <Code-snippets#message-formatting-bold-italic-code->` for
            more details.
        quote_entities (Tuple[:class:`telegram.MessageEntity`]): Optional. A JSON-serialized list
            of special entities that appear in the quote. It can be specified instead of
            :paramref:`quote_parse_mode`.
        quote_position (:obj:`int`): Optional. Position of the quote in the original message in
            UTF-16 code units.
    )allow_sending_without_replychat_idr4   quotequote_entitiesquote_parse_modequote_positionNr?   r4   rp   ro   rq   rs   rr   rt   r@   c                    t         	|   |       || _        || _        || _        || _        || _        t        |      | _        || _	        | j                  f| _
        | j                          y rB   )rC   rD   r4   rp   ro   rq   rs   r    rr   rt   rE   rF   )
rG   r4   rp   ro   rq   rs   rr   rt   r@   rH   s
            rI   rD   zReplyParameters.__init__  sl     	J/)29;V($)
/?CUD
 .<//+rJ   rK   rL   r$   rM   c                     | j                  |      }|yt        t        j                  |j	                  d      |            |d<   t
        |   ||      S )rO   Nrr   rP   rk   rV   s      rI   rR   zReplyParameters.de_json  sV    
 t$<!&}'<'<TXXFV=WY\']!^wDc22rJ   rX   )rY   rZ   r[   r\   r]   r!   r^   r   r   rl   r#   r_   r   r   r"   rD   r`   rR   ra   rb   s   @rI   rn   rn   n  s    4lI .26B#*6<@(, *. %S/* &.d^	
 } #3- !-!89 ! X&8 >B3H%3,4UO3	#	$3 3rJ   rn   N)Br\   typingr   r   r   r   r   telegram._chatr   telegram._dicer	   telegram._files.animationr
   telegram._files.audior   telegram._files.contactr   telegram._files.documentr   telegram._files.locationr   telegram._files.photosizer   telegram._files.stickerr   telegram._files.venuer   telegram._files.videor   telegram._files.videonoter   telegram._files.voicer   telegram._games.gamer   telegram._giveawayr   r   telegram._linkpreviewoptionsr   telegram._messageentityr   telegram._messageoriginr   telegram._paidmediar   telegram._payment.invoicer   telegram._pollr   telegram._storyr   telegram._telegramobjectr   telegram._utils.argumentparsingr    telegram._utils.defaultvaluer!   telegram._utils.typesr"   r#   telegramr$   r&   rd   rn    rJ   rI   <module>r      s   & E B B   / ' + - - / + ' ' / ' % 8 ; 1 1 - -  ! 3 > 5 4g3 g3TL3 L3^i3n i3rJ   