
    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
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mZ ddlmZ erddlmZ  G d de          Z G d de          ZdS )zQThis module contains an object that represents a Telegram MessageReaction Update.    N)Sequence)TYPE_CHECKING)Chat)ReactionCountReactionType)TelegramObject)User)de_json_optionalde_list_optionalparse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                        e Zd ZdZdZdddededej        de	e
         d	edz  f
 fd
Zeddedddd f fd            Z xZS )MessageReactionCountUpdatedaU  This class represents reaction changes on a message with anonymous reactions.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if the :attr:`chat`, :attr:`message_id`, :attr:`date` and :attr:`reactions`
    is equal.

    .. versionadded:: 20.8

    Args:
        chat (:class:`telegram.Chat`): The chat containing the message.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        date (:class:`datetime.datetime`): Date of the change in Unix time
            |datetime_localization|
        reactions (Sequence[:class:`telegram.ReactionCount`]): List of reactions that are present
            on the message

    Attributes:
        chat (:class:`telegram.Chat`): The chat containing the message.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        date (:class:`datetime.datetime`): Date of the change in Unix time
            |datetime_localization|
        reactions (tuple[:class:`telegram.ReactionCount`]): List of reactions that are present on
            the message
    )chatdate
message_id	reactionsN
api_kwargsr   r   r   r   r   c                   t                                          |           || _        || _        || _        t          |          | _        | j        | j        | j        | j        f| _        |                                  d S Nr   )	super__init__r   r   r   r   r   	_id_attrs_freeze)selfr   r   r   r   r   	__class__s         `/Users/shanyulin/my-agent/.venv/lib/python3.11/site-packages/telegram/_messagereactionupdated.pyr   z$MessageReactionCountUpdated.__init__F   sm     	J///	)"&	4Fy4Q4Q)T_diP    databot
Bot | Nonereturnc                    |                      |          }t          |          }t          |                    d          |          |d<   t	          |                    d          t
          |          |d<   t          |                    d          t          |          |d<   t                      	                    ||          S ),See :meth:`telegram.TelegramObject.de_json`.r   tzinfor   r   r#   r$   )
_parse_datar   r   getr
   r   r   r   r   de_jsonclsr#   r$   
loc_tzinfor    s       r!   r.   z#MessageReactionCountUpdated.de_jsonY   s     t$$ 2#66
%dhhv&6&6zJJJV'(8(8$DDV,TXXk-B-BMSVWW[wwDc222r"   N)__name__
__module____qualname____doc__	__slots__r   intdtmdatetimer   r   r   r   classmethodr.   __classcell__r    s   @r!   r   r   %   s         2I '+    l	
 M* tO     & 3 38 3, 3B_ 3 3 3 3 3 [3 3 3 3 3r"   r   c                        e Zd ZdZdZ	 	 ddddededej        de	e
         d	e	e
         d
edz  dedz  dedz  f fdZeddedddd f fd            Z xZS )MessageReactionUpdateda  This class represents a change of a reaction on a message performed by a user.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if the :attr:`chat`, :attr:`message_id`, :attr:`date`, :attr:`old_reaction`
    and :attr:`new_reaction` is equal.

    .. versionadded:: 20.8

    Args:
        chat (:class:`telegram.Chat`): The chat containing the message.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        date (:class:`datetime.datetime`): Date of the change in Unix time.
            |datetime_localization|
        old_reaction (Sequence[:class:`telegram.ReactionType`]): Previous list of reaction types
            that were set by the user.
        new_reaction (Sequence[:class:`telegram.ReactionType`]): New list of reaction types that
            were set by the user.
        user (:class:`telegram.User`, optional): The user that changed the reaction, if the user
            isn't anonymous.
        actor_chat (:class:`telegram.Chat`, optional): The chat on behalf of which the reaction was
            changed, if the user is anonymous.

    Attributes:
        chat (:class:`telegram.Chat`): The chat containing the message.
        message_id (:obj:`int`): Unique message identifier inside the chat.
        date (:class:`datetime.datetime`): Date of the change in Unix time.
            |datetime_localization|
        old_reaction (tuple[:class:`telegram.ReactionType`]): Previous list of reaction types
            that were set by the user.
        new_reaction (tuple[:class:`telegram.ReactionType`]): New list of reaction types that
            were set by the user.
        user (:class:`telegram.User`): Optional. The user that changed the reaction, if the user
            isn't anonymous.
        actor_chat (:class:`telegram.Chat`): Optional. The chat on behalf of which the reaction was
            changed, if the user is anonymous.
    )
actor_chatr   r   r   new_reactionold_reactionuserNr   r   r   r   rB   rA   rC   r@   r   c                T   t                                          |           || _        || _        || _        t          |          | _        t          |          | _        || _        || _	        | j        | j        | j        | j        | j        f| _
        |                                  d S r   )r   r   r   r   r   r   rB   rA   rC   r@   r   r   )
r   r   r   r   rB   rA   rC   r@   r   r    s
            r!   r   zMessageReactionUpdated.__init__   s     	J///	)"&	6H6V6V6H6V6V "&	'1 IOI
 	r"   r#   r$   r%   r&   c                    |                      |          }t          |          }t          |                    d          |          |d<   t	          |                    d          t
          |          |d<   t          |                    d          t          |          |d<   t          |                    d          t          |          |d<   t	          |                    d          t          |          |d<   t	          |                    d          t
          |          |d<   t                      
                    ||          S )	r(   r   r)   r   rB   rA   rC   r@   r+   )r,   r   r   r-   r
   r   r   r   r	   r   r.   r/   s       r!   r.   zMessageReactionUpdated.de_json   s    t$$ 2#66
%dhhv&6&6zJJJV'(8(8$DDV/0H0H,X[\\^/0H0H,X[\\^'(8(8$DDV-dhh|.D.DdCPP\wwDc222r"   )NNr2   )r3   r4   r5   r6   r7   r   r8   r9   r:   r   r   r	   r   r   r;   r.   r<   r=   s   @r!   r?   r?   h   s       # #JI" !"& '+    l	
 |, |, Tk 4K tO     B 3 38 3, 3BZ 3 3 3 3 3 [3 3 3 3 3r"   r?   )r6   r:   r9   collections.abcr   typingr   telegram._chatr   telegram._reactionr   r   telegram._telegramobjectr   telegram._userr	   telegram._utils.argumentparsingr
   r   r   telegram._utils.datetimer   r   telegram._utils.typesr   telegramr   r   r?    r"   r!   <module>rQ      s_  & X W     $ $ $ $ $ $                   : : : : : : : : 3 3 3 3 3 3       b b b b b b b b b b Q Q Q Q Q Q Q Q * * * * * * @3 @3 @3 @3 @3. @3 @3 @3F`3 `3 `3 `3 `3^ `3 `3 `3 `3 `3r"   