§
    §eî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mZmZ ddlmZmZ erdd	lmZ  G d
„ de¦  «        ZdS )zIThis module contains an object that represents an invite link for a chat.é    N)ÚTYPE_CHECKING)ÚTelegramObject)ÚUser)Úde_json_optionalÚto_timedelta)Úextract_tzinfo_from_defaultsÚfrom_timestampÚget_timedelta_value)ÚJSONDictÚ
TimePeriod)ÚBotc                   óü   ‡ — e Zd ZdZdZ	 	 	 	 	 	 dddœdedededed	ed
ej	        dz  de
dz  dedz  de
dz  dedz  de
dz  dedz  fˆ fd„Zede
ej        z  dz  fd„¦   «         Zeddedddd fˆ fd„¦   «         Zˆ xZS )ÚChatInviteLinku€  This object represents an invite link for a chat.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`invite_link`, :attr:`creator`, :attr:`creates_join_request`,
    :attr:`is_primary` and :attr:`is_revoked` are equal.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0

       * The argument & attribute :attr:`creates_join_request` is now required to comply with the
         Bot API.
       * Comparing objects of this class now also takes :attr:`creates_join_request` into account.

    Args:
        invite_link (:obj:`str`): The invite link.
        creator (:class:`telegram.User`): Creator of the link.
        creates_join_request (:obj:`bool`): :obj:`True`, if users joining the chat via
            the link need to be approved by chat administrators.

            .. versionadded:: 13.8
        is_primary (:obj:`bool`): :obj:`True`, if the link is primary.
        is_revoked (:obj:`bool`): :obj:`True`, if the link is revoked.
        expire_date (:class:`datetime.datetime`, optional): Date when the link will expire or
            has been expired.

            .. versionchanged:: 20.3
                |datetime_localization|
        member_limit (:obj:`int`, optional): Maximum number of users that can be members of the
            chat simultaneously after joining the chat via this invite link;
            :tg-const:`telegram.constants.ChatInviteLinkLimit.MIN_MEMBER_LIMIT`-
            :tg-const:`telegram.constants.ChatInviteLinkLimit.MAX_MEMBER_LIMIT`.
        name (:obj:`str`, optional): Invite link name.
            0-:tg-const:`telegram.constants.ChatInviteLinkLimit.NAME_LENGTH` characters.

            .. versionadded:: 13.8
        pending_join_request_count (:obj:`int`, optional): Number of pending join requests
            created using this link.

            .. versionadded:: 13.8
        subscription_period (:obj:`int` | :class:`datetime.timedelta`, optional): The number of
            seconds the subscription will be active for before the next payment.

            .. versionadded:: 21.5

            .. versionchanged:: v22.2
                |time-period-input|
        subscription_price (:obj:`int`, optional): The amount of Telegram Stars a user must pay
            initially and after each subsequent subscription period to be a member of the chat
            using the link.

            .. versionadded:: 21.5

    Attributes:
        invite_link (:obj:`str`): The invite link. If the link was created by another chat
            administrator, then the second part of the link will be replaced with ``'â€¦'``.
        creator (:class:`telegram.User`): Creator of the link.
        creates_join_request (:obj:`bool`): :obj:`True`, if users joining the chat via
            the link need to be approved by chat administrators.

            .. versionadded:: 13.8
        is_primary (:obj:`bool`): :obj:`True`, if the link is primary.
        is_revoked (:obj:`bool`): :obj:`True`, if the link is revoked.
        expire_date (:class:`datetime.datetime`): Optional. Date when the link will expire or
            has been expired.

            .. versionchanged:: 20.3
                |datetime_localization|
        member_limit (:obj:`int`): Optional. Maximum number of users that can be members
            of the chat simultaneously after joining the chat via this invite link;
            :tg-const:`telegram.constants.ChatInviteLinkLimit.MIN_MEMBER_LIMIT`-
            :tg-const:`telegram.constants.ChatInviteLinkLimit.MAX_MEMBER_LIMIT`.
        name (:obj:`str`): Optional. Invite link name.
            0-:tg-const:`telegram.constants.ChatInviteLinkLimit.NAME_LENGTH` characters.

            .. versionadded:: 13.8
        pending_join_request_count (:obj:`int`): Optional. Number of pending join requests
            created using this link.

            .. versionadded:: 13.8
        subscription_period (:obj:`int` | :class:`datetime.timedelta`): Optional. The number of
            seconds the subscription will be active for before the next payment.

            .. versionadded:: 21.5

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        subscription_price (:obj:`int`): Optional. The amount of Telegram Stars a user must pay
            initially and after each subsequent subscription period to be a member of the chat
            using the link.

            .. versionadded:: 21.5

    )Ú_subscription_periodÚcreates_join_requestÚcreatorÚexpire_dateÚinvite_linkÚ
is_primaryÚ
is_revokedÚmember_limitÚnameÚpending_join_request_countÚsubscription_priceN©Ú
api_kwargsr   r   r   r   r   r   r   r   r   Úsubscription_periodr   r   c                ó”  •— t          ¦   «                              |¬¦  «         || _        || _        || _        || _        || _        || _        || _        || _	        |	�t          |	¦  «        nd | _        t          |
¦  «        | _        || _        | j        | j        | j        | j        | j        f| _        |                      ¦   «          d S )Nr   )ÚsuperÚ__init__r   r   r   r   r   r   r   r   Úintr   r   r   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   r   r   r   r   r   r   r   r   r   Ú	__class__s                €ú\/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/_chatinvitelink.pyr    zChatInviteLink.__init__“   sÒ   ø€ õ  	‰Œ×Ò JÐÑ/Ô/Ð/à +ˆÔØ$ˆŒØ*>ˆÔ!Ø *ˆŒØ *ˆŒð 1<ˆÔØ(4ˆÔØ $ˆŒ	à/IÐ/U�CÐ*Ñ+Ô+Ð+Ð[_ð 	Ô'õ ;GÐGZÑ:[Ô:[ˆÔ!Ø.@ˆÔð ÔØÔ%ØŒLØŒOØŒOð
ˆŒð 	�Š‰Œˆˆˆó    Úreturnc                 ó.   — t          | j        d¬¦  «        S )Nr   )Ú	attribute)r
   r   )r$   s    r&   r   z"ChatInviteLink.subscription_period¿   s   € å" 4Ô#<ÐH]Ð^Ñ^Ô^Ð^r'   ÚdataÚbotz
Bot | Nonec                 ó:  •— |                       |¦  «        }t          |¦  «        }t          |                     d¦  «        t          |¦  «        |d<   t          |                     dd¦  «        |¬¦  «        |d<   t          ¦   «                              ||¬¦  «        S )z,See :meth:`telegram.TelegramObject.de_json`.r   r   N)Útzinfo)r+   r,   )Ú_parse_datar   r   Úgetr   r	   r   Úde_json)Úclsr+   r,   Ú
loc_tzinfor%   s       €r&   r1   zChatInviteLink.de_jsonÃ   s†   ø€ ð �Š˜tÑ$Ô$ˆõ 2°#Ñ6Ô6ˆ
å*¨4¯8ª8°IÑ+>Ô+>ÅÀcÑJÔJˆˆY‰Ý,¨T¯XªX°mÀTÑ-JÔ-JÐS]Ð^Ñ^Ô^ˆˆ]Ñå‰wŒw�Š D¨cˆÑ2Ô2Ð2r'   )NNNNNN)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ústrr   ÚboolÚdtmÚdatetimer!   r   r   r    ÚpropertyÚ	timedeltar   Úclassmethodr1   Ú__classcell__)r%   s   @r&   r   r   &   s�  ø€ € € € € ð\ð \ð|€Ið* ,0Ø#'ØØ15Ø15Ø)-ð*ð '+ð*ð *ð *àð*ð ð*ð #ð	*ð
 ð*ð ð*ð ”\ DÑ(ð*ð ˜D‘jð*ð �D‰jð*ð %(¨$¡Jð*ð (¨$Ñ.ð*ð   $™Jð*ð ˜t‘Oð*ð *ð *ð *ð *ð *ðX ð_ S¨3¬=Ñ%8¸4Ñ%?ð _ð _ð _ñ „Xð_ð ð
3ð 
3˜8ð 
3¨,ð 
3ÐBRð 
3ð 
3ð 
3ð 
3ð 
3ñ „[ð
3ð 
3ð 
3ð 
3ð 
3r'   r   )r7   r<   r;   Útypingr   Útelegram._telegramobjectr   Útelegram._userr   Útelegram._utils.argumentparsingr   r   Útelegram._utils.datetimer   r	   r
   Útelegram._utils.typesr   r   Útelegramr   r   © r'   r&   ú<module>rI      s  ðð& PÐ Oà Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ð Ð Ø JÐ JÐ JÐ JÐ JÐ JÐ JÐ Jðð ð ð ð ð ð ð ð ð ð
 7Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6àð ØÐÐÐÐÐðh3ð h3ð h3ð h3ð h3�^ñ h3ô h3ð h3ð h3ð h3r'   