§
    ¦eîiÔ(  ã                   ó:  — 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dS )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| _        |                      ¦   «          d S )Nr   )	ÚsuperÚ__init__r   Ú
get_memberr   ÚBotCommandScopeTyper   Ú	_id_attrsÚ_freeze)Úselfr   r   Ú	__class__s      €ú]/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/_botcommandscope.pyr   zBotCommandScope.__init__P   sR   ø€ Ý‰Œ×Ò JÐÑ/Ô/Ð/Ýœ­Ô)FÈÈdÑSÔSˆŒ	Øœ)˜ˆŒà�Š‰Œˆˆˆó    ÚdataÚbotz
Bot | NoneÚreturnc                 óÀ  •— |                       |¦  «        }| j        t          | j        t          | j        t          | j        t          | j	        t          | j        t          | j        t          i}| t          u rG|                     d¦  «        |v r0||                     d¦  «                                      ||¬¦  «        S t'          ¦   «                              ||¬¦  «        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Õ/ØÔ!Õ#AØÔÕ!=ØÔ'Õ)MØŒHÕ)ØÔ#Õ%FØŒOÕ6ð<
ˆð •/Ð!Ð! d§h¢h¨vÑ&6Ô&6¸.Ð&HÐ&HØ! $§(¢(¨6Ñ"2Ô"2Ô3×;Ò;ÀÈ3Ð;ÑOÔOÐOÝ‰wŒw�Š D¨cˆÑ2Ô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Ô?€GˆU�3ŒZÐ?Ð?Ñ?ØAØ$-Ô$AÔ$SÐ�u˜S”zÐSÐSÑSØKØ"+Ô"?Ô"O€O�U˜3”ZÐOÐOÑOØIØ*3Ô*GÔ*_Ð˜U 3œZÐ_Ð_Ñ_ØQØ Ô4Ô9€Dˆ%�Œ*Ð9Ð9Ñ9Ø>Ø&/Ô&CÔ&WÐ˜˜sœÐWÐWÑWØMØ'Ô;ÔG€K��s”ÐGÐGÑGØEàCGð ð ð ˜Sð °¸D±ð ð ð ð ð ð ð ð3ð 3˜8ð 3¨,ð 3ÐBSð 3ð 3ð 3ð 3ð 3ñ „[ð3ð 3ð 3ð 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                óŠ   •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «          d S ©N©r   r   )r   r   r   r   r   ©r   r   r   s     €r   r   zBotCommandScopeDefault.__init__†   s4   ø€ Ý‰Œ×Ò�oÔ5À*ÐÑMÔMÐMØ�Š‰Œˆˆˆr    ©r2   r3   r4   r5   r6   r   r   r:   r;   s   @r   r&   r&   y   sf   ø€ € € € € ðð ð €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                óŠ   •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «          d S r?   )r   r   r   r   r   rA   s     €r   r   z'BotCommandScopeAllPrivateChats.__init__–   s4   ø€ Ý‰Œ×Ò�oÔ?ÈJÐÑWÔWÐWØ�Š‰Œˆˆˆr    rB   r;   s   @r   r'   r'   ‹   sf   ø€ € € € € ðð ð €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                óŠ   •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «          d S r?   )r   r   r   r   r   rA   s     €r   r   z%BotCommandScopeAllGroupChats.__init__¥   s4   ø€ Ý‰Œ×Ò�oÔ=È*ÐÑUÔUÐUØ�Š‰Œˆˆˆr    rB   r;   s   @r   r(   r(   ›   óf   ø€ € € € € ðð ð €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                óŠ   •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «          d S r?   )r   r   r   r   r   rA   s     €r   r   z-BotCommandScopeAllChatAdministrators.__init__´   s5   ø€ Ý‰Œ×Ò�oÔ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                ób  •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «         5  t          |t          ¦  «        r|                     d¦  «        r|nt          |¦  «        | _	        | j
        | j	        f| _        d d d ¦  «         d S # 1 swxY w Y   d S ©Nr@   ú@)r   r   r   r   Ú	_unfrozenÚ
isinstancer7   Ú
startswithÚintrL   r   r   ©r   rL   r   r   s      €r   r   zBotCommandScopeChat.__init__Ë   sã   ø€ Ý‰Œ×Ò�oÔ2¸zÐÑJÔJÐJØ�^Š^ÑÔð 	7ð 	7å% g­sÑ3Ô3Ða¸×8JÒ8JÈ3Ñ8OÔ8OÐa��ÕUXÐY`ÑUaÔUað ŒLð #œi¨¬Ð6ˆDŒNð		7ð 	7ð 	7ñ 	7ô 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7øøøð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ó   ÁAB$Â$B(Â+B(©
r2   r3   r4   r5   r6   r7   rS   r   r   r:   r;   s   @r   r*   r*   ¹   óq   ø€ € € € € ðð ð €IàLPð 7ð 7ð 7  c¡	ð 7¸(ÀT¹/ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 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                ób  •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «         5  t          |t          ¦  «        r|                     d¦  «        r|nt          |¦  «        | _	        | j
        | j	        f| _        d d d ¦  «         d S # 1 swxY w Y   d S rN   )r   r   r   r   rP   rQ   r7   rR   rS   rL   r   r   rT   s      €r   r   z*BotCommandScopeChatAdministrators.__init__æ   sã   ø€ Ý‰Œ×Ò�oÔAÈjÐÑYÔYÐYØ�^Š^ÑÔð 	7ð 	7å% g­sÑ3Ô3Ða¸×8JÒ8JÈ3Ñ8OÔ8OÐa��ÕUXÐY`ÑUaÔUað ŒLð #œi¨¬Ð6ˆDŒNð		7ð 	7ð 	7ñ 	7ô 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7øøøð 	7ð 	7ð 	7ð 	7ð 	7ð 	7rU   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                ó|  •— t          ¦   «                              t          j        |¬¦  «         |                      ¦   «         5  t          |t          ¦  «        r|                     d¦  «        r|nt          |¦  «        | _	        || _
        | j        | j	        | j
        f| _        d d d ¦  «         d S # 1 swxY w Y   d S 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ÀjÐÑQÔQÐQØ�^Š^ÑÔð 	Eð 	Eå% g­sÑ3Ô3Ða¸×8JÒ8JÈ3Ñ8OÔ8OÐa��ÕUXÐY`ÑUaÔUað ŒLð !(ˆDŒLØ"œi¨¬°t´|ÐDˆDŒNð	Eð 	Eð 	Eñ 	Eô 	Eð 	Eð 	Eð 	Eð 	Eð 	Eð 	Eð 	Eøøøð 	Eð 	Eð 	Eð 	Eð 	Eð 	Es   ÁA!B1Â1B5Â8B5rV   r;   s   @r   r,   r,   ï   sˆ   ø€ € € € € ðð ð$ '€IàZ^ð Eð Eð E  c¡	ð E°Cð EÈÐSWÉð Eð Eð Eð Eð Eð Eð Eð Eð 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Ð Là 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'à Ð Ð Ð Ð Ð Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø  Ð  Ð  Ð  Ð  Ð  Ø *Ð *Ð *Ð *Ð *Ð *àð ØÐÐÐÐÐðU3ð U3ð U3ð U3ð U3�nñ U3ô U3ð U3ðpð ð ð ð ˜_ñ ô ð ð$ð ð ð ð  _ñ ô ð ð ð ð ð ð  ?ñ ô ð ðð ð ð ð ¨?ñ ô ð ð7ð 7ð 7ð 7ð 7˜/ñ 7ô 7ð 7ð67ð 7ð 7ð 7ð 7¨ñ 7ô 7ð 7ð6Eð Eð Eð Eð E ñ Eô Eð Eð Eð Er    