
    > /in                         d Z ddlmZmZmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ  ed      Z G d	 d
eeef         Zy)z1This module contains the ChatMemberHandler class.    )FinalOptionalTypeVar)Update)DEFAULT_TRUE)DVType)BaseHandler)CCTHandlerCallbackRTc                        e Zd ZU dZdZdZee   ed<   	 dZ	ee   ed<   	 dZ
ee   ed<   	 eefd	eeeef   d
edee   f fdZdedefdZ xZS )ChatMemberHandlera  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`

    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_member_typesMY_CHAT_MEMBERr   CHAT_MEMBER   ANY_CHAT_MEMBERcallbackr   blockc                 6    t         |   ||       || _        y )N)r   )super__init__r   )selfr   r   r   	__class__s       U/srv/sistema/bot/venv/lib/python3.12/site-packages/telegram/ext/_chatmemberhandler.pyr   zChatMemberHandler.__init__R   s     	/0A    updatereturnc                    t        |t              rv|j                  s|j                  sy| j                  | j
                  k(  ry| j                  | j                  k(  rt        |j                        S t        |j                        S y)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   r   r   bool)r   r   s     r   check_updatezChatMemberHandler.check_update\   sr     ff%))V-?-?%%)=)==%%)9)99F..//--..r   )__name__
__module____qualname____doc__	__slots__r   r   int__annotations__r   r   r   r   r   r
   r   r   r$   r   objectr%   __classcell__)r   s   @r   r   r      s    'R 'I!#NE#J#_Ks\"#OU3Z#0 "0*	B!&#r/2B B d|	B6 d r   r   N)r)   typingr   r   r   telegramr   telegram._utils.defaultvaluer   telegram._utils.typesr   telegram.ext._basehandlerr	   telegram.ext._utils.typesr
   r   r   r    r   r   <module>r6      s?   & 8 + +  5 ( 1 :T]OFCK0 Or   