
    Yi                         S r SSKJrJrJr  SSKJr  SSKJr  SSK	J
r
Jr  SSKJr  SSKJr  SSKJrJr  \" S	5      r " S
 S\\\\4   5      rg)z1This module contains the ChatMemberHandler class.    )FinalOptionalTypeVar)Update)DEFAULT_TRUE)SCTDVType)BaseHandler)parse_chat_id)CCTHandlerCallbackRTc                      ^  \ rS rSr% SrSrSr\\   \	S'    Sr
\\   \	S'    Sr\\   \	S	'    \\S
4SSS\\\\4   S\S\\   S\\\      4
U 4S jjjrS\S\4S jrSrU =r$ )ChatMemberHandler    a  Handler class to handle Telegram updates that contain a chat member update.

Warning:
    When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
    attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.

Examples:
    :any:`Chat Member Bot <examples.chatmemberbot>`

.. versionadded:: 13.4

Args:
    callback (:term:`coroutine function`): The callback function for this handler. Will be
        called when :meth:`check_update` has determined that an update should be processed by
        this handler. Callback signature::

            async def callback(update: Update, context: CallbackContext)

        The return value of the callback is usually ignored except for the special case of
        :class:`telegram.ext.ConversationHandler`.
    chat_member_types (:obj:`int`, optional): Pass one of :attr:`MY_CHAT_MEMBER`,
        :attr:`CHAT_MEMBER` or :attr:`ANY_CHAT_MEMBER` to specify if this handler should handle
        only updates with :attr:`telegram.Update.my_chat_member`,
        :attr:`telegram.Update.chat_member` or both. Defaults to :attr:`MY_CHAT_MEMBER`.
    block (:obj:`bool`, optional): Determines whether the return value of the callback should
        be awaited before processing the next handler in
        :meth:`telegram.ext.Application.process_update`. Defaults to :obj:`True`.

        .. seealso:: :wiki:`Concurrency`
    chat_id (:obj:`int` | Collection[:obj:`int`], optional): Filters chat member updates from
        specified chat ID(s) only.
        .. versionadded:: 21.3

Attributes:
    callback (:term:`coroutine function`): The callback function for this handler.
    chat_member_types (:obj:`int`): Optional. Specifies if this handler should handle
        only updates with :attr:`telegram.Update.my_chat_member`,
        :attr:`telegram.Update.chat_member` or both.
    block (:obj:`bool`): Determines whether the return value of the callback should be
        awaited before processing the next handler in
        :meth:`telegram.ext.Application.process_update`.

)	_chat_idschat_member_typesMY_CHAT_MEMBERr   CHAT_MEMBER   ANY_CHAT_MEMBERNselfzChatMemberHandler[CCT, RT]callbackr   blockchat_idc                 L   > [         TU ]  XS9  X l        [        U5      U l        g )N)r   )super__init__r   r   r   )r   r   r   r   r   	__class__s        S/app/.venv/lib/python3.13/site-packages/telegram/ext/_handlers/chatmemberhandler.pyr   ChatMemberHandler.__init__Y   s'     	/0A&w/    updatereturnc                    [        U[        5      (       d  gUR                  (       d  UR                  (       d  gU R                  (       a6  UR
                  (       a%  UR
                  R                  U R                  ;  a  gU R                  U R                  :X  a  gU R                  U R                  :X  a  [        UR                  5      $ [        UR                  5      $ )zDetermines whether an update should be passed to this handler's :attr:`callback`.

Args:
    update (:class:`telegram.Update` | :obj:`object`): Incoming update.

Returns:
    :obj:`bool`

FT)
isinstancer   my_chat_memberchat_memberr   effective_chatidr   r   r   bool)r   r$   s     r!   check_updateChatMemberHandler.check_updatee   s     &&))%%););NN%%%%((>!!T%9%99!!T%5%55**++F))**r#   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   int__annotations__r   r   r   r   r   r   r   r	   r,   r   r   r   objectr-   __static_attributes____classcell__)r    s   @r!   r   r       s    *XI "$NE#J#_Ks\"#OU3Z#0 "0*&*
0*
0!&#r/2
0 
0 d|	
0
 #c(#
0 
0+6 +d + +r#   r   N)r3   typingr   r   r   telegramr   telegram._utils.defaultvaluer   telegram._utils.typesr   r	   "telegram.ext._handlers.basehandlerr
   #telegram.ext._utils._update_parsingr   telegram.ext._utils.typesr   r   r   r    r#   r!   <module>rB      sD   & 8 + +  5 - : = :T]]+FCO4 ]+r#   