Ë
    S"“jœ  ã                   óR   — d dl Z ddlmZmZ ddlmZ  G d„ de j                  «      Zy)é    Né   )ÚerrorsÚutils)Útypesc                   ó”   — e Zd ZdZdddddœd„Zed„ «       Zd„ Zed„ «       Zd„ Z	ed	„ «       Z
ed
„ «       Zed„ «       Zed„ «       Zd„ Zy)Ú
ChatGetterz’
    Helper base class that introduces the `chat`, `input_chat`
    and `chat_id` properties and `get_chat` and `get_input_chat`
    methods.
    N)Ú
input_chatÚchatÚ	broadcastc                óJ   — || _         || _        || _        || _        d | _        y ©N)Ú
_chat_peerÚ_input_chatÚ_chatÚ
_broadcastÚ_client)ÚselfÚ	chat_peerr	   r
   r   s        ú^/var/www/api.ozpay.ru/ozpay/venv/lib/python3.12/site-packages/telethon/tl/custom/chatgetter.pyÚ__init__zChatGetter.__init__   s&   € Ø#ˆŒØ%ˆÔØˆŒ
Ø#ˆŒØˆ�ó    c                 ó   — | j                   S )a|  
        Returns the :tl:`User`, :tl:`Chat` or :tl:`Channel` where this object
        belongs to. It may be `None` if Telegram didn't send the chat.

        If you only need the ID, use `chat_id` instead.

        If you need to call a method which needs
        this chat, use `input_chat` instead.

        If you're using `telethon.events`, use `get_chat()` instead.
        )r   ©r   s    r   r
   zChatGetter.chat   s   € ð �z‰zÐr   c              ƒ   ó„  K  — | j                   �t        | j                   dd«      rW| j                  «       ƒ d{  –—† r?	 | j                  j	                  | j
                  «      ƒ d{  –—† | _         | j                   S | j                   S 7 ŒO7 Œ## t        $ r' | j                  «       ƒ d{  –—†7   Y | j                   S w xY w­w)a  
        Returns `chat`, but will make an API call to find the
        chat unless it's already cached.

        If you only need the ID, use `chat_id` instead.

        If you need to call a method which needs
        this chat, use `get_input_chat()` instead.
        NÚmin)r   ÚgetattrÚget_input_chatr   Ú
get_entityr   Ú
ValueErrorÚ_refetch_chatr   s    r   Úget_chatzChatGetter.get_chat#   s¥   è ø€ ð �J‰JÐ¤'¨$¯*©*°e¸TÔ"BØ×-Ñ-Ó/×/Ð/ð+àŸ,™,×1Ñ1°$×2BÑ2BÓC×Cð ”
ð �z‰zÐˆt�z‰zÐð 0øð DùÜò +Ø×(Ñ(Ó*×*Ò*Ø�z‰zÐð+üsP   ‚7C ¹B	ºC ¿(B Á'BÁ(	B Á1C ÂB ÂB=Â)B,Â*B=Â/C Â<B=Â=C c                 ó^  — | j                   €|| j                  rp| j                  rd	 | j                  j                  j	                  t        j                  | j                  d¬«      «      j                  «       | _         | j                   S | j                   S # t        $ r Y | j                   S w xY w)a   
        This :tl:`InputPeer` is the input version of the chat where the
        message was sent. Similarly to `input_sender
        <telethon.tl.custom.sendergetter.SenderGetter.input_sender>`, this
        doesn't have things like username or similar, but still useful in
        some cases.

        Note that this might not be available if the library doesn't
        have enough information available.
        F)Úadd_mark)	r   r   r   Ú_mb_entity_cacheÚgetr   Úget_peer_idÚ_as_input_peerÚAttributeErrorr   s    r   r	   zChatGetter.input_chat7   s—   € ð ×ÑÐ#¨¯ª¸D¿LºLðØ#'§<¡<×#@Ñ#@×#DÑ#DÜ×)Ñ)¨$¯/©/ÀEÔJó$LßLZÉNÓL\ð Ô ð
 ×ÑÐˆt×ÑÐøô "ò Øà×ÑÐðús   ¦AB Â	B,Â+B,c              ƒ   ó²  K  — | j                   €ˆ| j                  r|| j                  rp	 | j                  }| j                  j                  d«      2 3 d{  –—† }|j                  |k(  sŒ|j
                  | _        |j                  | _         | j                  S | j                  S 7 ŒO6 	 | j                  S # t        j                  $ r Y | j                  S w xY w­w)z|
        Returns `input_chat`, but will make an API call to find the
        input chat unless it's already cached.
        Néd   )r	   Úchat_idr   Úiter_dialogsÚidÚentityr   Úinput_entityr   r   ÚRPCError)r   ÚtargetÚds      r   r   zChatGetter.get_input_chatL   sÂ   è ø€ ð
 �?‰?Ð" t§|¢|¸¿ºð	àŸ™�Ø#Ÿ|™|×8Ñ8¸Ó=÷ ð ˜!Ø—t‘t˜v“~Ø%&§X¡X˜œ
Ø+,¯>©>˜Ô(Øð ×ÑÐˆt×ÑÐðøÑ=ð ×ÑÐøô —?‘?ò Øà×ÑÐðüsX   ‚%C¨'B3 ÁB%ÁB#ÁB%ÁB3 Á(#B3 ÂCÂ#B%Â%B3 Â'CÂ3CÃCÃCÃCc                 ó\   — | j                   rt        j                  | j                   «      S dS )aæ  
        Returns the marked chat integer ID. Note that this value **will
        be different** from ``peer_id`` for incoming private messages, since
        the chat *to* which the messages go is to your own person, but
        the *chat* itself is with the one who sent the message.

        TL;DR; this gets the ID that you expect.

        If there is a chat in the object, `chat_id` will *always* be set,
        which is why you should use it instead of `chat.id <chat>`.
        N)r   r   r&   r   s    r   r+   zChatGetter.chat_id_   s$   € ð 6:·_²_Œu× Ñ  §¡Ó1ÐNÈ$ÐNr   c                 óf   — | j                   r$t        | j                   t        j                  «      S dS )zÛ
        `True` if the message was sent as a private message.

        Returns `None` if there isn't enough information
        (e.g. on `events.MessageDeleted <telethon.events.messagedeleted.MessageDeleted>`).
        N)r   Ú
isinstancer   ÚPeerUserr   s    r   Ú
is_privatezChatGetter.is_privaten   s&   € ð ?C¿oºoŒz˜$Ÿ/™/¬5¯>©>Ó:ÐWÐSWÐWr   c                 óR  — | j                   €:t        | j                  d«      r$t        | j                  j                  «      | _         t        | j                  t        j                  «      r| j                   €y| j                    S t        | j                  t        j                  «      S )zÜ
        True if the message was sent on a group or megagroup.

        Returns `None` if there isn't enough information
        (e.g. on `events.MessageDeleted <telethon.events.messagedeleted.MessageDeleted>`).
        Nr   )
r   Úhasattrr
   Úboolr   r5   r   r   ÚPeerChannelÚPeerChatr   s    r   Úis_groupzChatGetter.is_groupx   st   € ð �?‰?Ð"¤w¨t¯y©y¸+Ô'FÜ" 4§9¡9×#6Ñ#6Ó7ˆDŒOä�d—o‘o¤u×'8Ñ'8Ô9Ø�‰Ð&ØàŸ?™?Ð*Ð*ä˜$Ÿ/™/¬5¯>©>Ó:Ð:r   c                 óJ   — t        | j                  t        j                  «      S )z9`True` if the message was sent on a megagroup or channel.)r5   r   r   r;   r   s    r   Ú
is_channelzChatGetter.is_channelŒ   s   € ô
 ˜$Ÿ/™/¬5×+<Ñ+<Ó=Ð=r   c              ƒ   ó   K  — y­w)zB
        Re-fetches chat information through other means.
        N© r   s    r   r    zChatGetter._refetch_chat“   s   è ø� ùs   ‚r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr
   r!   r	   r   r+   r7   r=   r?   r    rA   r   r   r   r      s£   „ ñð
°TÀÐPTô ð ñó ðòð( ñ ó ð ò( ð& ñOó ðOð ñXó ðXð ñ;ó ð;ð& ñ>ó ð>ór   r   )ÚabcÚ r   r   Útlr   ÚABCr   rA   r   r   ú<module>rK      s    ðÛ 
ç Ý ôO�—‘õ Or   