
    Yi)                        S r SSKJrJrJrJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  \(       a  SSKJr   " S S	\	5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)zFThis module contains objects representing Telegram bot command scopes.    )TYPE_CHECKINGFinalOptionalUnion)	constants)TelegramObject)enum)JSONDict)Botc            	       <  ^  \ rS rSr% SrSr\R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                   r\	\
   \S	'    \R                  R"                  r\	\
   \S
'    SS.S\
S\\   4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )BotCommandScope    a  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U ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g )Nr   )	super__init__r	   
get_memberr   BotCommandScopeTyper   	_id_attrs_freeze)selfr   r   	__class__s      D/app/.venv/lib/python3.13/site-packages/telegram/_botcommandscope.pyr   BotCommandScope.__init__O   sA    J/)F)FS	))    databotr   returnc                   > U R                  U5      nU(       d  gU R                  [        U R                  [        U R
                  [        U R                  [        U R                  [        U R                  [        U R                  [        0nU [        L a5  UR!                  S5      U;   a   X1R#                  S5         R%                  XS9$ [&        TU ]I  XS9$ )a  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.

Nr   )r%   r&   )_parse_datar   BotCommandScopeDefaultr   BotCommandScopeAllPrivateChatsr   BotCommandScopeAllGroupChatsr   $BotCommandScopeAllChatAdministratorsr   BotCommandScopeChatr   !BotCommandScopeChatAdministratorsr   BotCommandScopeChatMemberr   getpopde_jsonr   )clsr%   r&   _class_mappingr!   s       r"   r3   BotCommandScope.de_jsonV   s    & t$ KK/!!#A!='')MHH)##%FOO6<
 /!dhhv&6.&H!((6"23;;;OOwD22r$   )r   r   )N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   str__annotations__r   r   r   r   r   r   r   r
   r   classmethodr3   __static_attributes____classcell__r!   s   @r"   r   r       s;   : I#77??GU3Z?A$-$A$A$S$SuSzSK"+"?"?"O"OOU3ZOI*3*G*G*_*_U3Z_Q 4499D%*9>&/&C&C&W&WsWM';;GGKsGEFJ S (1C   >B#3H%#3,4UO#3	#	$#3 #3r$   r   c                   F   ^  \ rS rSrSrSrSS.S\\   4U 4S jjjrSr	U =r
$ )r*   }   aW  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U ]  [        R                  US9  U R	                  5         g Nr   r   )r   r   r   r   r   r    r   r!   s     r"   r   BotCommandScopeDefault.__init__   s$    o55*Mr$   r7   r8   r9   r:   r;   r<   r   r
   r   r@   rA   rB   s   @r"   r*   r*   }   s(     I;? hx&8  r$   r*   c                   F   ^  \ rS rSrSrSrSS.S\\   4U 4S jjjrSr	U =r
$ )r+      zRepresents 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`.
rE   Nr   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rG   )r   r   r   r   r   rI   s     r"   r   'BotCommandScopeAllPrivateChats.__init__   s$    o??JWr$   rK   rB   s   @r"   r+   r+      s(     I;? hx&8  r$   r+   c                   F   ^  \ rS rSrSrSrSS.S\\   4U 4S jjjrSr	U =r
$ )r,      zRepresents 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`.
rE   Nr   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rG   )r   r   r   r   r   rI   s     r"   r   %BotCommandScopeAllGroupChats.__init__   s$    o==*Ur$   rK   rB   s   @r"   r,   r,      (     I;? hx&8  r$   r,   c                   F   ^  \ rS rSrSrSrSS.S\\   4U 4S jjjrSr	U =r
$ )r-      zRepresents 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`.
rE   Nr   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rG   )r   r   r   r   r   rI   s     r"   r   -BotCommandScopeAllChatAdministrators.__init__   s%    oEER\]r$   rK   rB   s   @r"   r-   r-      rT   r$   r-   c                   T   ^  \ rS rSrSrSrSS.S\\\4   S\	\
   4U 4S jjjrS	rU =r$ )
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   r\   r   c                F  > [         TU ]  [        R                  US9  U R	                  5          [        U[        5      (       a  UR                  S5      (       a  UO
[        U5      U l	        U R                  U R                  4U l        S S S 5        g ! , (       d  f       g = fNrH   @)r   r   r   r   	_unfrozen
isinstancer=   
startswithintr\   r   r   r    r\   r   r!   s      r"   r   BotCommandScopeChat.__init__   sv    o22zJ^^%gs338J8J38O8OUXY`Ua L #ii6DN	    AB
B r   r\   r7   r8   r9   r:   r;   r<   r   r=   rc   r   r
   r   r@   rA   rB   s   @r"   r.   r.      7     IUY 7c3h 7@R 7 7r$   r.   c                   T   ^  \ rS rSrSrSrSS.S\\\4   S\	\
   4U 4S jjjrS	rU =r$ )
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|
r[   Nr   r\   r   c                F  > [         TU ]  [        R                  US9  U R	                  5          [        U[        5      (       a  UR                  S5      (       a  UO
[        U5      U l	        U R                  U R                  4U l        S S S 5        g ! , (       d  f       g = fr^   )r   r   r   r   r`   ra   r=   rb   rc   r\   r   r   rd   s      r"   r   *BotCommandScopeChatAdministrators.__init__   sv    oAAjY^^%gs338J8J38O8OUXY`Ua L #ii6DN	 rf   rg   rh   rB   s   @r"   r/   r/      ri   r$   r/   c                   X   ^  \ rS rSrSrSrSS.S\\\4   S\S\	\
   4U 4S	 jjjrS
rU =r$ )r0      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.
)r\   user_idNr   r\   rp   r   c                h  > [         TU ]  [        R                  US9  U R	                  5          [        U[        5      (       a  UR                  S5      (       a  UO
[        U5      U l	        X l
        U R                  U R                  U R                  4U l        S S S 5        g ! , (       d  f       g = fr^   )r   r   r   r   r`   ra   r=   rb   rc   r\   rp   r   r   )r    r\   rp   r   r!   s       r"   r   "BotCommandScopeChatMember.__init__  s     	o99jQ^^%gs338J8J38O8OUXY`Ua L !(L"iit||DDN s   A,B##
B1)r   r\   rp   rh   rB   s   @r"   r0   r0      sJ    $ 'I [_	ES#X	E14	EEMhEW	E 	Er$   r0   N)r;   typingr   r   r   r   telegramr   telegram._telegramobjectr   telegram._utilsr	   telegram._utils.typesr
   r   r   r*   r+   r,   r-   r.   r/   r0   rE   r$   r"   <module>rx      s   ( M 8 8  3   *Z3n Z3z_ $_  ? ? 7/ 767 76E Er$   