§
    ©eîiQ'  ã                   ó"  — 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dS )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                   ó6  ‡ — 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| _        |  	                    ¦   «          d S )Nr   )
ÚsuperÚ__init__r	   Ú
get_memberr   ÚMessageOriginTyper   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   Ú	__class__s       €ú[/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/_messageorigin.pyr   zMessageOrigin.__init__P   sg   ø€ õ 	‰Œ×Ò JÐÑ/Ô/Ð/åœ­Ô)DÀdÈDÑQÔQˆŒ	Ø"&ˆŒ	ð ŒIØŒIð
ˆŒð 	�Š‰Œˆˆˆó    ÚdataÚbotz
Bot | NoneÚreturnc                 ó  •— |                       |¦  «        }| j        t          | j        t          | j        t          | j        t          i}| t          u rG| 
                    d¦  «        |v r0||                     d¦  «                                      ||¬¦  «        S t          |¦  «        }t          | 
                    d¦  «        |¬¦  «        |d<   d|v r,t          | 
                    d¦  «        t           |¦  «        |d<   d|v r,t          | 
                    d¦  «        t"          |¦  «        |d<   d|v r,t          | 
                    d¦  «        t"          |¦  «        |d<   t%          ¦   «                              ||¬¦  «        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Õ'ØŒOÕ4ØŒHÕ'ØŒKÕ-ð	:
ˆð •-ÐÐ D§H¢H¨VÑ$4Ô$4¸Ð$FÐ$FØ! $§(¢(¨6Ñ"2Ô"2Ô3×;Ò;ÀÈ3Ð;ÑOÔOÐOå1°#Ñ6Ô6ˆ
Ý% d§h¢h¨vÑ&6Ô&6¸zÐJÑJÔJˆˆV‰à˜DÐ Ð Ý"2°4·8²8¸MÑ3JÔ3JÍDÐRUÑ"VÔ"VˆD�Ñà˜DÐ Ð Ý"2°4·8²8¸MÑ3JÔ3JÍDÐRUÑ"VÔ"VˆD�Ñà�Tˆ>ˆ>Ý+¨D¯HªH°VÑ,<Ô,<½dÀCÑHÔHˆD�‰Lå‰wŒw�Š D¨cˆÑ2Ô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Ô7€Dˆ%�Œ*Ð7Ð7Ñ7Ø<Ø'Ô9ÔE€K��s”ÐEÐEÑEØCØ Ô2Ô7€Dˆ%�Œ*Ð7Ð7Ñ7Ø<Ø#Ô5Ô=€GˆU�3ŒZÐ=Ð=Ñ=Ø?ð '+ðð ð àðð Œlðð
 ˜t‘Oðð ð ð ð ð ð$ ð3ð 3˜8ð 3¨,ð 3À/ð 3ð 3ð 3ð 3ð 3ñ „[ð3ð 3ð 3ð 3ð 3r#   r   c                   óJ   ‡ — 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        ||¬¦  «         |                      ¦   «         5  || _        d d d ¦  «         d S # 1 swxY w Y   d S ©N)r   r   r   )r   r   r   Ú	_unfrozenr)   )r    r   r)   r   r!   s       €r"   r   zMessageOriginUser.__init__–   s¢   ø€ õ 	‰Œ×Ò˜dœi¨d¸zÐÑJÔJÐJà�^Š^ÑÔð 	1ð 	1Ø%0ˆDÔð	1ð 	1ð 	1ñ 	1ô 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1øøøð 	1ð 	1ð 	1ð 	1ð 	1ð 	1ó   ¿AÁAÁA)r8   r9   r:   r;   r<   r?   r@   r   r   r   rB   rC   s   @r"   r-   r-   �   s   ø€ € € € € ðð ð$ !€Ið '+ð
1ð 
1ð 
1àŒlð
1ð ð
1ð
 ˜t‘Oð
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1r#   r-   c                   óJ   ‡ — 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        ||¬¦  «         |                      ¦   «         5  || _        d d d ¦  «         d S # 1 swxY w Y   d S rF   )r   r   r   rG   rJ   )r    r   rJ   r   r!   s       €r"   r   z MessageOriginHiddenUser.__init__¸   s£   ø€ õ 	‰Œ×Ò˜dÔ.°TÀjÐÑQÔQÐQà�^Š^ÑÔð 	:ð 	:Ø)9ˆDÔ!ð	:ð 	:ð 	:ñ 	:ô 	:ð 	:ð 	:ð 	:ð 	:ð 	:ð 	:ð 	:øøøð 	:ð 	:ð 	:ð 	:ð 	:ð 	:rH   )r8   r9   r:   r;   r<   r?   r@   r=   r   r   rB   rC   s   @r"   r.   r.   £   s   ø€ € € € € ðð ð$ &€Ið '+ð
:ð 
:ð 
:àŒlð
:ð ð
:ð
 ˜t‘Oð
:ð 
:ð 
:ð 
:ð 
:ð 
:ð 
:ð 
:ð 
:ð 
:r#   r.   c                   óX   ‡ — 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        ||¬¦  «         |                      ¦   «         5  || _        || _        d d d ¦  «         d S # 1 swxY w Y   d S rF   )r   r   r   rG   r*   rM   )r    r   r*   rM   r   r!   s        €r"   r   zMessageOriginChat.__init__á   s¾   ø€ õ 	‰Œ×Ò˜dœi¨d¸zÐÑJÔJÐJà�^Š^ÑÔð 	Að 	AØ%0ˆDÔØ0@ˆDÔ!ð	Að 	Að 	Añ 	Aô 	Að 	Að 	Að 	Að 	Að 	Að 	Að 	Aøøøð 	Að 	Að 	Að 	Að 	Að 	As   ¿AÁAÁ"Ar7   )r8   r9   r:   r;   r<   r?   r@   r   r=   r   r   rB   rC   s   @r"   r/   r/   Å   s¨   ø€ € € € € ðð ð,€Ið (,ð	Að '+ðAð Að AàŒlðAð ðAð  ™*ð	Að ˜t‘OðAð Að Að Að Að Að Að Að Að Ar#   r/   c                   ó\   ‡ — 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        ||¬¦  «         |                      ¦   «         5  || _        || _        || _        d d d ¦  «         d S # 1 swxY w Y   d S rF   )r   r   r   rG   r+   rP   rM   )r    r   r+   rP   rM   r   r!   s         €r"   r   zMessageOriginChannel.__init__  sÄ   ø€ õ 	‰Œ×Ò˜dœl°À*ÐÑMÔMÐMà�^Š^ÑÔð 	Að 	AØ"ˆDŒIØ#-ˆDŒOØ0@ˆDÔ!ð	Að 	Að 	Añ 	Aô 	Að 	Að 	Að 	Að 	Að 	Að 	Að 	Aøøøð 	Að 	Að 	Að 	Að 	Að 	As   ¿A"Á"A&Á)A&r7   )r8   r9   r:   r;   r<   r?   r@   r   Úintr=   r   r   rB   rC   s   @r"   r0   r0   ð   s³   ø€ € € € € ðð ð,€Ið (,ðAð '+ðAð Að AàŒlðAð ðAð ð	Að
  ™*ðAð ˜t‘OðAð Að Að Að Að Að Að Að 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]      sÜ  ðð& MÐ Là Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø <Ð <Ð <Ð <Ð <Ð <Ø QÐ QÐ QÐ QÐ QÐ QÐ QÐ QØ *Ð *Ð *Ð *Ð *Ð *àð ØÐÐÐÐÐðY3ð Y3ð Y3ð Y3ð Y3�Nñ Y3ô Y3ð Y3ðx1ð 1ð 1ð 1ð 1˜ñ 1ô 1ð 1ðD:ð :ð :ð :ð :˜mñ :ô :ð :ðD(Að (Að (Að (Að (A˜ñ (Aô (Að (AðV+Að +Að +Að +Að +A˜=ñ +Aô +Að +Að +Að +Ar#   