Ë
    †jQ'  ã                   ó  — d Z ddl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	lmZ dd
lmZmZ ddlmZ erddlmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)zFThis module contains the classes that represent Telegram MessageOigin.é    N)ÚTYPE_CHECKINGÚFinal)Ú	constants)ÚChat)ÚTelegramObject)ÚUser)Úenum)Úde_json_optional)Úextract_tzinfo_from_defaultsÚfrom_timestamp)ÚJSONDict)ÚBotc                   ór  ‡ — e Zd ZU dZdZej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ddœd	e	d
ej                  dedz  fˆ fd„Zeddedddd fˆ fd„«       Zˆ xZS )ÚMessageOriginaŸ  
    Base class for telegram MessageOrigin object, it can be one of:

    * :class:`MessageOriginUser`
    * :class:`MessageOriginHiddenUser`
    * :class:`MessageOriginChat`
    * :class:`MessageOriginChannel`

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

    .. versionadded:: 20.8

    Args:
        type (:obj:`str`): Type of the message origin, can be on of:
            :attr:`~telegram.MessageOrigin.USER`, :attr:`~telegram.MessageOrigin.HIDDEN_USER`,
            :attr:`~telegram.MessageOrigin.CHAT`, or :attr:`~telegram.MessageOrigin.CHANNEL`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|

    Attributes:
        type (:obj:`str`): Type of the message origin, can be on of:
            :attr:`~telegram.MessageOrigin.USER`, :attr:`~telegram.MessageOrigin.HIDDEN_USER`,
            :attr:`~telegram.MessageOrigin.CHAT`, or :attr:`~telegram.MessageOrigin.CHANNEL`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
    )ÚdateÚtypeÚUSERÚHIDDEN_USERÚCHATÚCHANNELN©Ú
api_kwargsr   r   r   c                óâ   •— t         ‰| �  |¬«       t        j                  t        j
                  ||«      | _        || _        | j                  | j                  f| _        | j                  «        y )Nr   )
ÚsuperÚ__init__r	   Ú
get_memberr   ÚMessageOriginTyper   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   Ú	__class__s       €úV/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/_messageorigin.pyr   zMessageOrigin.__init__P   sZ   ø€ ô 	‰Ñ JÐÔ/äŸ™¬×)DÑ)DÀdÈDÓQˆŒ	Ø"&ˆŒ	ð �I‰IØ�I‰Ið
ˆŒð 	�‰�ó    ÚdataÚbotz
Bot | NoneÚreturnc                 óŠ  •— | j                  |«      }| j                  t        | j                  t        | j
                  t        | j                  t        i}| t        u r8|j                  d«      |v r%||j                  d«         j                  ||¬«      S t        |«      }t        |j                  d«      |¬«      |d<   d|v r#t        |j                  d«      t         |«      |d<   d|v r#t        |j                  d«      t"        |«      |d<   d|v r#t        |j                  d«      t"        |«      |d<   t$        ‰| �1  ||¬«      S )zˆConverts JSON data to the appropriate :class:`MessageOrigin` object, i.e. takes
        care of selecting the correct subclass.
        r   )r$   r%   r   )ÚtzinfoÚsender_userÚsender_chatÚchat)Ú_parse_datar   ÚMessageOriginUserr   ÚMessageOriginHiddenUserr   ÚMessageOriginChatr   ÚMessageOriginChannelr   ÚgetÚpopÚde_jsonr   r   r
   r   r   r   )Úclsr$   r%   Ú_class_mappingÚ
loc_tzinfor!   s        €r"   r3   zMessageOrigin.de_jsonb   s$  ø€ ð
 �‰˜tÓ$ˆð �H‰HÔ'Ø�O‰OÔ4Ø�H‰HÔ'Ø�K‰KÔ-ð	:
ˆð ”-Ñ D§H¡H¨VÓ$4¸Ñ$FØ! $§(¡(¨6Ó"2Ñ3×;Ñ;ÀÈ3Ð;ÓOÐOä1°#Ó6ˆ
Ü% d§h¡h¨vÓ&6¸zÔJˆˆV‰à˜DÑ Ü"2°4·8±8¸MÓ3JÌDÐRUÓ"VˆD�Ñà˜DÑ Ü"2°4·8±8¸MÓ3JÌDÐRUÓ"VˆD�Ñà�T‰>Ü+¨D¯H©H°VÓ,<¼dÀCÓHˆD�‰Lä‰w‰ D¨cˆÓ2Ð2r#   ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   ÚstrÚ__annotations__r   r   r   ÚdtmÚdatetimer   r   Úclassmethodr3   Ú__classcell__©r!   s   @r"   r   r   %   sÜ   ø… ñð8€Ið
 !×2Ñ2×7Ñ7€Dˆ%�‰*Ó7Ø<Ø'×9Ñ9×EÑE€K��s‘ÓEØCØ ×2Ñ2×7Ñ7€Dˆ%�‰*Ó7Ø<Ø#×5Ñ5×=Ñ=€GˆU�3‰ZÓ=Ø?ð '+òàðð �l‰lðð
 ˜t‘Oõð$ ñ3˜8ð 3¨,ð 3À/ô 3ó ô3r#   r   c                   óT   ‡ — e Zd ZdZdZddœdej                  dededz  fˆ fd„Z	ˆ xZ
S )	r-   av  
    The message was originally sent by a known user.

    .. versionadded:: 20.8

    Args:
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_user (:class:`telegram.User`): User that sent the message originally.

    Attributes:
        type (:obj:`str`): Type of the message origin. Always
            :tg-const:`~telegram.MessageOrigin.USER`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_user (:class:`telegram.User`): User that sent the message originally.
    )r)   Nr   r   r)   r   c                ó–   •— t         ‰| �  | j                  ||¬«       | j                  «       5  || _        d d d «       y # 1 sw Y   y xY w©N)r   r   r   )r   r   r   Ú	_unfrozenr)   )r    r   r)   r   r!   s       €r"   r   zMessageOriginUser.__init__–   sD   ø€ ô 	‰Ñ˜dŸi™i¨d¸zÐÔJà�^‰^Óñ 	1Ø%0ˆDÔ÷	1÷ 	1ñ 	1úó	   ®?¿A)r8   r9   r:   r;   r<   r?   r@   r   r   r   rB   rC   s   @r"   r-   r-   �   sB   ø„ ñð$ !€Ið '+ò
1à�l‰lð
1ð ð
1ð
 ˜t‘O÷
1ñ 
1r#   r-   c                   óT   ‡ — e Zd ZdZdZddœdej                  dededz  fˆ fd„Z	ˆ xZ
S )	r.   aŠ  
    The message was originally sent by an unknown user.

    .. versionadded:: 20.8

    Args:
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_user_name (:obj:`str`): Name of the user that sent the message originally.

    Attributes:
        type (:obj:`str`): Type of the message origin. Always
            :tg-const:`~telegram.MessageOrigin.HIDDEN_USER`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_user_name (:obj:`str`): Name of the user that sent the message originally.
    )Úsender_user_nameNr   r   rJ   r   c                ó–   •— t         ‰| �  | j                  ||¬«       | j                  «       5  || _        d d d «       y # 1 sw Y   y xY wrF   )r   r   r   rG   rJ   )r    r   rJ   r   r!   s       €r"   r   z MessageOriginHiddenUser.__init__¸   sF   ø€ ô 	‰Ñ˜d×.Ñ.°TÀjÐÔQà�^‰^Óñ 	:Ø)9ˆDÔ!÷	:÷ 	:ñ 	:úrH   )r8   r9   r:   r;   r<   r?   r@   r=   r   r   rB   rC   s   @r"   r.   r.   £   sB   ø„ ñð$ &€Ið '+ò
:à�l‰lð
:ð ð
:ð
 ˜t‘O÷
:ñ 
:r#   r.   c                   ób   ‡ — e Zd ZdZdZ	 d
ddœdej                  dededz  de	dz  fˆ fd	„Z
ˆ xZS )r/   aÊ  
    The message was originally sent on behalf of a chat to a group chat.

    .. versionadded:: 20.8

    Args:
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_chat (:class:`telegram.Chat`): Chat that sent the message originally.
        author_signature (:obj:`str`, optional): For messages originally sent by an anonymous chat
            administrator, original message author signature

    Attributes:
        type (:obj:`str`): Type of the message origin. Always
            :tg-const:`~telegram.MessageOrigin.CHAT`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        sender_chat (:class:`telegram.Chat`): Chat that sent the message originally.
        author_signature (:obj:`str`): Optional. For messages originally sent by an anonymous chat
            administrator, original message author signature
    )Úauthor_signaturer*   Nr   r   r*   rM   r   c                ó¤   •— t         ‰| �  | j                  ||¬«       | j                  «       5  || _        || _        d d d «       y # 1 sw Y   y xY wrF   )r   r   r   rG   r*   rM   )r    r   r*   rM   r   r!   s        €r"   r   zMessageOriginChat.__init__á   sP   ø€ ô 	‰Ñ˜dŸi™i¨d¸zÐÔJà�^‰^Óñ 	AØ%0ˆDÔØ0@ˆDÔ!÷	A÷ 	Añ 	Aús   ®AÁAr7   )r8   r9   r:   r;   r<   r?   r@   r   r=   r   r   rB   rC   s   @r"   r/   r/   Å   sa   ø„ ñð,€Ið (,ð	Að '+òAà�l‰lðAð ðAð  ™*ð	Að ˜t‘O÷Añ Ar#   r/   c                   óf   ‡ — e Zd ZdZdZ	 dddœdej                  dedede	dz  d	e
dz  f
ˆ fd
„Zˆ xZS )r0   aÕ  
    The message was originally sent to a channel chat.

    .. versionadded:: 20.8

    Args:
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        chat (:class:`telegram.Chat`): Channel chat to which the message was originally sent.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        author_signature (:obj:`str`, optional): Signature of the original post author.

    Attributes:
        type (:obj:`str`): Type of the message origin. Always
            :tg-const:`~telegram.MessageOrigin.CHANNEL`.
        date (:obj:`datetime.datetime`): Date the message was sent originally.
            |datetime_localization|
        chat (:class:`telegram.Chat`): Channel chat to which the message was originally sent.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        author_signature (:obj:`str`): Optional. Signature of the original post author.
    )rM   r+   Ú
message_idNr   r   r+   rP   rM   r   c                ó²   •— t         ‰| �  | j                  ||¬«       | j                  «       5  || _        || _        || _        d d d «       y # 1 sw Y   y xY wrF   )r   r   r   rG   r+   rP   rM   )r    r   r+   rP   rM   r   r!   s         €r"   r   zMessageOriginChannel.__init__  sV   ø€ ô 	‰Ñ˜dŸl™l°À*ÐÔMà�^‰^Óñ 	AØ"ˆDŒIØ#-ˆDŒOØ0@ˆDÔ!÷	A÷ 	Añ 	Aús   ®AÁAr7   )r8   r9   r:   r;   r<   r?   r@   r   Úintr=   r   r   rB   rC   s   @r"   r0   r0   ð   sl   ø„ ñð,€Ið (,ðAð '+òAà�l‰lðAð ðAð ð	Að
  ™*ðAð ˜t‘O÷Añ Ar#   r0   )r;   r@   r?   Útypingr   r   Útelegramr   Útelegram._chatr   Útelegram._telegramobjectr   Útelegram._userr   Útelegram._utilsr	   Útelegram._utils.argumentparsingr
   Útelegram._utils.datetimer   r   Útelegram._utils.typesr   r   r   r-   r.   r/   r0   © r#   r"   ú<module>r]      su   ðñ& Mã ß 'å Ý Ý 3Ý Ý  Ý <ß QÝ *áÝôY3�Nô Y3ôx1˜ô 1ôD:˜mô :ôD(A˜ô (AôV+A˜=õ +Ar#   