L idZddlmZmZmZddlmZddlmZddl m Z m Z ddl m Z ddlmZddlmZmZed ZGd d e eeefZy ) z1This module contains the ChatMemberHandler class.)FinalOptionalTypeVar)Update) DEFAULT_TRUE)SCTDVType) BaseHandler) parse_chat_id)CCTHandlerCallbackRTc eZdZUdZdZdZeeed< dZ eeed< dZ eeed< ee d fd d d e e eefd edeedeeef fd ZdedefdZxZS)ChatMemberHandleraHandler 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 ` .. 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_idschat_member_typesMY_CHAT_MEMBERr CHAT_MEMBERANY_CHAT_MEMBERNselfzChatMemberHandler[CCT, RT]callbackrblockchat_idcVt|||||_t||_y)N)r)super__init__rr r)rrrrr __class__s n/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_handlers/chatmemberhandler.pyrzChatMemberHandler.__init__Zs+ /0A&w/updatereturnct|tsy|js |jsy|jr/|j r#|j j |jvry|j|jk(ry|j|jk(rt|jSt|jS)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) isinstancermy_chat_member chat_memberreffective_chatidrrrbool)rr"s r check_updatezChatMemberHandler.check_updatefs&&)%%);); NN%%%%((>  ! !T%9%9 9  ! !T%5%5 5**+ +F))**r!)__name__ __module__ __qualname____doc__ __slots__rrint__annotations__rrrr rr rr r*rrrobjectr+ __classcell__)rs@r rr!s*XI"$NE#J#_Ks\"#OU3Z#0 "0*&* 0* 0!&#r/2 0 0d| 0 #c(# 0+6+d+r!rN)r/typingrrrtelegramrtelegram._utils.defaultvaluertelegram._utils.typesrr "telegram.ext._handlers.basehandlerr #telegram.ext._utils._update_parsingr telegram.ext._utils.typesr r rrr!r r=sD&8++5-:=: T]]+ FCO4]+r!