Ë
    †jÔ(  ã                   ó  — d 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 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 G d„ de«      Z G d„ de«      Z G d„ de«      Zy)zFThis module contains objects representing Telegram bot command scopes.é    )ÚTYPE_CHECKINGÚFinal)Ú	constants)ÚTelegramObject)Úenum)ÚJSONDict)ÚBotc                   ó  ‡ — 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<   	 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d
z  fˆ fd„Zeddedddd fˆ fd„«       Zˆ xZS )ÚBotCommandScopea/  Base class for objects that represent the scope to which bot commands are applied.
    Currently, the following 7 scopes are supported:

    * :class:`telegram.BotCommandScopeDefault`
    * :class:`telegram.BotCommandScopeAllPrivateChats`
    * :class:`telegram.BotCommandScopeAllGroupChats`
    * :class:`telegram.BotCommandScopeAllChatAdministrators`
    * :class:`telegram.BotCommandScopeChat`
    * :class:`telegram.BotCommandScopeChatAdministrators`
    * :class:`telegram.BotCommandScopeChatMember`

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`type` is equal. For subclasses with additional attributes,
    the notion of equality is overridden.

    Note:
        Please see the `official docs`_ on how Telegram determines which commands to display.

    .. _`official docs`: https://core.telegram.org/bots/api#determining-list-of-commands

    .. versionadded:: 13.7

    Args:
        type (:obj:`str`): Scope type.

    Attributes:
        type (:obj:`str`): Scope type.
    )ÚtypeÚDEFAULTÚALL_PRIVATE_CHATSÚALL_GROUP_CHATSÚALL_CHAT_ADMINISTRATORSÚCHATÚCHAT_ADMINISTRATORSÚCHAT_MEMBERN©Ú
api_kwargsr   r   c                ó¾   •— t         ‰| �  |¬«       t        j                  t        j
                  ||«      | _        | j                  f| _        | j                  «        y )Nr   )	ÚsuperÚ__init__r   Ú
get_memberr   ÚBotCommandScopeTyper   Ú	_id_attrsÚ_freeze)Úselfr   r   Ú	__class__s      €úX/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/_botcommandscope.pyr   zBotCommandScope.__init__P   sC   ø€ Ü‰Ñ JÐÔ/ÜŸ™¬×)FÑ)FÈÈdÓSˆŒ	ØŸ)™)˜ˆŒà�‰�ó    ÚdataÚbotz
Bot | NoneÚreturnc                 ó¬  •— | j                  |«      }| j                  t        | j                  t        | j
                  t        | j                  t        | j                  t        | j                  t        | j                  t        i}| t        u r8|j!                  d«      |v r%||j#                  d«         j%                  ||¬«      S t&        ‰| �I  ||¬«      S )a6  Converts JSON data to the appropriate :class:`BotCommandScope` object, i.e. takes
        care of selecting the correct subclass.

        Args:
            data (dict[:obj:`str`, ...]): The JSON data.
            bot (:class:`telegram.Bot`, optional): The bot associated with this object. Defaults to
                :obj:`None`, in which case shortcut methods will not be available.

                .. versionchanged:: 21.4
                   :paramref:`bot` is now optional and defaults to :obj:`None`

        Returns:
            The Telegram object.

        r   )r!   r"   )Ú_parse_datar   ÚBotCommandScopeDefaultr   ÚBotCommandScopeAllPrivateChatsr   ÚBotCommandScopeAllGroupChatsr   Ú$BotCommandScopeAllChatAdministratorsr   ÚBotCommandScopeChatr   Ú!BotCommandScopeChatAdministratorsr   ÚBotCommandScopeChatMemberr   ÚgetÚpopÚde_jsonr   )Úclsr!   r"   Ú_class_mappingr   s       €r   r/   zBotCommandScope.de_jsonW   s»   ø€ ð" �‰˜tÓ$ˆð �K‰KÔ/Ø×!Ñ!Ô#AØ×ÑÔ!=Ø×'Ñ'Ô)MØ�H‰HÔ)Ø×#Ñ#Ô%FØ�O‰OÔ6ð<
ˆð ”/Ñ! d§h¡h¨vÓ&6¸.Ñ&HØ! $§(¡(¨6Ó"2Ñ3×;Ñ;ÀÈ3Ð;ÓOÐOÜ‰w‰ D¨cˆÓ2Ð2r    )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   ÚstrÚ__annotations__r   r   r   r   r   r   r   r   Úclassmethodr/   Ú__classcell__©r   s   @r   r   r   !   s!  ø… ñð: €Ià#×7Ñ7×?Ñ?€GˆU�3‰ZÓ?ØAØ$-×$AÑ$A×$SÑ$SÐ�u˜S‘zÓSØKØ"+×"?Ñ"?×"OÑ"O€O�U˜3‘ZÓOØIØ*3×*GÑ*G×*_Ñ*_Ð˜U 3™ZÓ_ØQØ ×4Ñ4×9Ñ9€Dˆ%�‰*Ó9Ø>Ø&/×&CÑ&C×&WÑ&WÐ˜˜s™ÓWØMØ'×;Ñ;×GÑG€K��s‘ÓGØEàCGò ˜Sð °¸D±õ ð ñ3˜8ð 3¨,ð 3ÐBSô 3ó ô3r    r   c                   ó8   ‡ — e Zd ZdZdZddœdedz  fˆ fd„Zˆ xZS )r&   ao  Represents the default scope of bot commands. Default commands are used if no commands with
    a `narrower scope`_ are specified for the user.

    .. _`narrower scope`: https://core.telegram.org/bots/api#determining-list-of-commands

    .. versionadded:: 13.7
    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.DEFAULT`.
    © Nr   r   c                ód   •— t         ‰| �  t        j                  |¬«       | j	                  «        y ©N©r   r   )r   r   r   r   r   ©r   r   r   s     €r   r   zBotCommandScopeDefault.__init__†   s$   ø€ Ü‰Ñœo×5Ñ5À*ÐÔMØ�‰�r    ©r2   r3   r4   r5   r6   r   r   r:   r;   s   @r   r&   r&   y   s'   ø„ ñð €Ià8<ò  h°¡o÷ ñ r    r&   c                   ó8   ‡ — e Zd ZdZdZddœdedz  fˆ fd„Zˆ xZS )r'   zÑRepresents the scope of bot commands, covering all private chats.

    .. versionadded:: 13.7

    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.ALL_PRIVATE_CHATS`.
    r=   Nr   r   c                ód   •— t         ‰| �  t        j                  |¬«       | j	                  «        y r?   )r   r   r   r   r   rA   s     €r   r   z'BotCommandScopeAllPrivateChats.__init__–   s$   ø€ Ü‰Ñœo×?Ñ?ÈJÐÔWØ�‰�r    rB   r;   s   @r   r'   r'   ‹   s'   ø„ ñð €Ià8<ò  h°¡o÷ ñ r    r'   c                   ó8   ‡ — e Zd ZdZdZddœdedz  fˆ fd„Zˆ xZS )r(   zÛRepresents the scope of bot commands, covering all group and supergroup chats.

    .. versionadded:: 13.7
    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.ALL_GROUP_CHATS`.
    r=   Nr   r   c                ód   •— t         ‰| �  t        j                  |¬«       | j	                  «        y r?   )r   r   r   r   r   rA   s     €r   r   z%BotCommandScopeAllGroupChats.__init__¥   s$   ø€ Ü‰Ñœo×=Ñ=È*ÐÔUØ�‰�r    rB   r;   s   @r   r(   r(   ›   ó'   ø„ ñð €Ià8<ò  h°¡o÷ ñ r    r(   c                   ó8   ‡ — e Zd ZdZdZddœdedz  fˆ fd„Zˆ xZS )r)   zñRepresents the scope of bot commands, covering all group and supergroup chat administrators.

    .. versionadded:: 13.7
    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.ALL_CHAT_ADMINISTRATORS`.
    r=   Nr   r   c                ód   •— t         ‰| �  t        j                  |¬«       | j	                  «        y r?   )r   r   r   r   r   rA   s     €r   r   z-BotCommandScopeAllChatAdministrators.__init__´   s%   ø€ Ü‰Ñœo×EÑEÐR\ÐÔ]Ø�‰�r    rB   r;   s   @r   r)   r)   ª   rG   r    r)   c                   óB   ‡ — e Zd ZdZdZddœdeez  dedz  fˆ fd„Zˆ xZ	S )r*   aì  Represents the scope of bot commands, covering a specific chat.

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

    .. versionadded:: 13.7

    Args:
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|

    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.CHAT`.
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|
    ©Úchat_idNr   rL   r   c                ó.  •— t         ‰| �  t        j                  |¬«       | j	                  «       5  t        |t        «      r|j                  d«      r|n
t        |«      | _	        | j                  | j                  f| _        d d d «       y # 1 sw Y   y xY w©Nr@   ú@)r   r   r   r   Ú	_unfrozenÚ
isinstancer7   Ú
startswithÚintrL   r   r   ©r   rL   r   r   s      €r   r   zBotCommandScopeChat.__init__Ë   sy   ø€ Ü‰Ñœo×2Ñ2¸zÐÔJØ�^‰^Óñ 	7ä% g¬sÔ3¸×8JÑ8JÈ3Ô8O‘ÔUXÐY`ÓUað ŒLð #Ÿi™i¨¯©Ð6ˆDŒN÷		7÷ 	7ñ 	7úó   ±ABÂB©
r2   r3   r4   r5   r6   r7   rS   r   r   r:   r;   s   @r   r*   r*   ¹   ó2   ø„ ñð €IàLPò 7  c¡	ð 7¸(ÀT¹/÷ 7ñ 7r    r*   c                   óB   ‡ — e Zd ZdZdZddœdeez  dedz  fˆ fd„Zˆ xZ	S )r+   a(  Represents the scope of bot commands, covering all administrators of a specific group or
    supergroup chat.

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

    .. versionadded:: 13.7

    Args:
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|
    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.CHAT_ADMINISTRATORS`.
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|
    rK   Nr   rL   r   c                ó.  •— t         ‰| �  t        j                  |¬«       | j	                  «       5  t        |t        «      r|j                  d«      r|n
t        |«      | _	        | j                  | j                  f| _        d d d «       y # 1 sw Y   y xY wrN   )r   r   r   r   rP   rQ   r7   rR   rS   rL   r   r   rT   s      €r   r   z*BotCommandScopeChatAdministrators.__init__æ   sy   ø€ Ü‰Ñœo×AÑAÈjÐÔYØ�^‰^Óñ 	7ä% g¬sÔ3¸×8JÑ8JÈ3Ô8O‘ÔUXÐY`ÓUað ŒLð #Ÿi™i¨¯©Ð6ˆDŒN÷		7÷ 	7ñ 	7úrU   rV   r;   s   @r   r+   r+   Ô   rW   r    r+   c                   óF   ‡ — e Zd ZdZdZddœdeez  dededz  fˆ fd„Zˆ xZ	S )	r,   a°  Represents the scope of bot commands, covering a specific member of a group or supergroup
    chat.

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

    .. versionadded:: 13.7

    Args:
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|
        user_id (:obj:`int`): Unique identifier of the target user.

    Attributes:
        type (:obj:`str`): Scope type :tg-const:`telegram.BotCommandScope.CHAT_MEMBER`.
        chat_id (:obj:`str` | :obj:`int`): |chat_id_group|
        user_id (:obj:`int`): Unique identifier of the target user.
    )rL   Úuser_idNr   rL   r[   r   c                óR  •— t         ‰| �  t        j                  |¬«       | j	                  «       5  t        |t        «      r|j                  d«      r|n
t        |«      | _	        || _
        | j                  | j                  | j                  f| _        d d d «       y # 1 sw Y   y xY wrN   )r   r   r   r   rP   rQ   r7   rR   rS   rL   r[   r   r   )r   rL   r[   r   r   s       €r   r   z"BotCommandScopeChatMember.__init__  sŠ   ø€ Ü‰Ñœo×9Ñ9ÀjÐÔQØ�^‰^Óñ 	Eä% g¬sÔ3¸×8JÑ8JÈ3Ô8O‘ÔUXÐY`ÓUað ŒLð !(ˆDŒLØ"Ÿi™i¨¯©°t·|±|ÐDˆDŒN÷	E÷ 	Eñ 	Eús   ±A#BÂB&rV   r;   s   @r   r,   r,   ï   s?   ø„ ñð$ '€IàZ^ò E  c¡	ð E°Cð EÈÐSWÉ÷ Eñ Er    r,   N)r5   Útypingr   r   Útelegramr   Útelegram._telegramobjectr   Útelegram._utilsr   Útelegram._utils.typesr   r	   r   r&   r'   r(   r)   r*   r+   r,   r=   r    r   ú<module>rb      s…   ðñ( Mç 'å Ý 3Ý  Ý *áÝôU3�nô U3ôp˜_ô ô$ _ô ô  ?ô ô¨?ô ô7˜/ô 7ô67¨ô 7ô6E õ Er    