o
    GC™hG  ã                   @   s´   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 er0ddlmZ G dd	„ d	e
ƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ de
ƒZdS )zEThis module contains objects that represents a Telegram ReactionType.é    )ÚTYPE_CHECKINGÚFinalÚLiteralÚOptionalÚUnion)Ú	constants)ÚTelegramObject)Úenum)ÚJSONDict)ÚBotc                	       s¾   e Zd ZU dZdZejjZeej e	d< 	 ejj
Z
eej e	d< 	 ejjZeej e	d< 	 ddœdeed	 ejf d
ee f‡ fdd„Ze	ddee ded ded  f‡ fdd„ƒZ‡  ZS )ÚReactionTypeaÄ  Base class for Telegram ReactionType Objects.
    There exist :class:`telegram.ReactionTypeEmoji`, :class:`telegram.ReactionTypeCustomEmoji`
    and :class:`telegram.ReactionTypePaid`.

    .. versionadded:: 20.8
    .. versionchanged:: 21.5

        Added paid reaction.

    Args:
        type (:obj:`str`): Type of the reaction. Can be
            :attr:`~telegram.ReactionType.EMOJI`, :attr:`~telegram.ReactionType.CUSTOM_EMOJI` or
            :attr:`~telegram.ReactionType.PAID`.
    Attributes:
        type (:obj:`str`): Type of the reaction. Can be
            :attr:`~telegram.ReactionType.EMOJI`, :attr:`~telegram.ReactionType.CUSTOM_EMOJI` or
            :attr:`~telegram.ReactionType.PAID`.

    )ÚtypeÚEMOJIÚCUSTOM_EMOJIÚPAIDN©Ú
api_kwargsr   )ÚemojiÚcustom_emojiÚpaidr   c                   s,   t ƒ j|d t tj||¡| _|  ¡  d S ©Nr   )ÚsuperÚ__init__r	   Ú
get_memberr   r   r   Ú_freeze)Úselfr   r   ©Ú	__class__© úK/var/www/html/govbot/env/lib/python3.10/site-packages/telegram/_reaction.pyr   A   s   zReactionType.__init__ÚdataÚbotr   Úreturnc                    sx   |   |¡}|du rdS |s| tu rdS | jt| jt| jti}| tu r4| d¡|v r4|| 	d¡  
||¡S tƒ j
||dS ©z,See :meth:`telegram.TelegramObject.de_json`.Nr   )r    r!   )Ú_parse_datar   r   ÚReactionTypeEmojir   ÚReactionTypeCustomEmojir   ÚReactionTypePaidÚgetÚpopÚde_jsonr   )Úclsr    r!   Ú_class_mappingr   r   r   r*   O   s   
ýzReactionType.de_json©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   Ú__annotations__r   r   r   r   r   r
   r   Úclassmethodr*   Ú__classcell__r   r   r   r   r       s4   
 úÿþúÿÿÿþr   c                       ó8   e Zd ZdZdZddœdedee f‡ fdd„Z‡  Z	S )	r%   aP  
    Represents a reaction with a normal emoji.

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

    .. versionadded:: 20.8

    Args:
        emoji (:obj:`str`): Reaction emoji. It can be one of
            :const:`telegram.constants.ReactionEmoji`.

    Attributes:
        type (:obj:`str`): Type of the reaction,
            always :tg-const:`telegram.ReactionType.EMOJI`.
        emoji (:obj:`str`): Reaction emoji. It can be one of
        :const:`telegram.constants.ReactionEmoji`.
    )r   Nr   r   r   c                   óP   t ƒ jtj|d |  ¡  || _| jf| _W d   ƒ d S 1 s!w   Y  d S ©N)r   r   )r   r   r   r   Ú	_unfrozenr   Ú	_id_attrs)r   r   r   r   r   r   r   ~   ó
   
"þzReactionTypeEmoji.__init__©
r.   r/   r0   r1   r2   Ústrr   r
   r   r5   r   r   r   r   r%   h   s    üþür%   c                       r6   )	r&   aü  
    Represents a reaction with a custom emoji.

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

    .. versionadded:: 20.8

    Args:
        custom_emoji_id (:obj:`str`): Custom emoji identifier.

    Attributes:
        type (:obj:`str`): Type of the reaction,
            always :tg-const:`telegram.ReactionType.CUSTOM_EMOJI`.
        custom_emoji_id (:obj:`str`): Custom emoji identifier.

    )Úcustom_emoji_idNr   r>   r   c                   r7   r8   )r   r   r   r   r9   r>   r:   )r   r>   r   r   r   r   r       r;   z ReactionTypeCustomEmoji.__init__r<   r   r   r   r   r&   ‹   s    üþür&   c                       s4   e Zd ZdZdZddœdee f‡ fdd„Z‡  ZS )r'   z¸
    The reaction is paid.

    .. versionadded:: 21.5

    Attributes:
        type (:obj:`str`): Type of the reaction,
            always :tg-const:`telegram.ReactionType.PAID`.
    r   Nr   r   c                   s   t ƒ jtj|d |  ¡  d S r8   )r   r   r   r   r   )r   r   r   r   r   r   º   s   zReactionTypePaid.__init__)	r.   r/   r0   r1   r2   r   r
   r   r5   r   r   r   r   r'   ­   s    
$r'   c                	       sj   e Zd ZdZdZddœdededee f‡ fdd	„Z	e
	dd
ee ded ded  f‡ fdd„ƒZ‡  ZS )ÚReactionCountai  This class represents a reaction added to a message along with the number of times it was
    added.

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

    .. versionadded:: 20.8

    Args:
        type (:class:`telegram.ReactionType`): Type of the reaction.
        total_count (:obj:`int`): Number of times the reaction was added.

    Attributes:
        type (:class:`telegram.ReactionType`): Type of the reaction.
        total_count (:obj:`int`): Number of times the reaction was added.
    )Útotal_countr   Nr   r   r@   r   c                   s4   t ƒ j|d || _|| _| j| jf| _|  ¡  d S r   )r   r   r   r@   r:   r   )r   r   r@   r   r   r   r   r   Ö   s   þzReactionCount.__init__r    r!   r   r"   c                    s8   |   |¡}|s	dS t | d¡|¡|d< tƒ j||dS r#   )r$   r   r*   r(   r   )r+   r    r!   r   r   r   r*   è   s
   
zReactionCount.de_jsonr-   )r.   r/   r0   r1   r2   r   Úintr   r
   r   r4   r*   r5   r   r   r   r   r?   ¿   s(    
ûþýûÿÿÿþr?   N)r1   Útypingr   r   r   r   r   Útelegramr   Útelegram._telegramobjectr   Útelegram._utilsr	   Útelegram._utils.typesr
   r   r   r%   r&   r'   r?   r   r   r   r   Ú<module>   s   H#"