L idZddlmZmZddlmZddlmZddlm Z m Z ddl m Z ddl mZmZddlmZmZed ZGd d e eeefZy ) z9This module contains the BusinessConnectionHandler class.)OptionalTypeVar)Update) DEFAULT_TRUE)SCTDVType) BaseHandler) parse_chat_idparse_username)CCTHandlerCallbackRTc ~eZdZdZdZddefdddeeee fde e e de e e d eef fd Zd ed efd ZxZS)BusinessConnectionHandlerahHandler class to handle Telegram :attr:`Business Connections `. .. versionadded:: 21.1 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) user_id (:obj:`int` | Collection[:obj:`int`], optional): Filters requests to allow only those which are from the specified user ID(s). username (:obj:`str` | Collection[:obj:`str`], optional): Filters requests to allow only those which are from the specified username(s). 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. 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`. ) _user_ids _usernamesNselfz"BusinessConnectionHandler[CCT, RT]callbackuser_idusernameblockcht|||t||_t ||_y)N)r)super__init__r rr r)rrrrr __class__s v/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_handlers/businessconnectionhandler.pyrz"BusinessConnectionHandler.__init__Ds/ /&w/(2updatereturnc t|tr~|jrr|js |jsy|jj j |jvry|jj j|jvSy)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` TF) isinstancerbusiness_connectionrruseridr)rrs r check_updatez&BusinessConnectionHandler.check_updatePsk ff %&*D*D>>$//))..11T^^C--22;;tN Nr)__name__ __module__ __qualname____doc__ __slots__rr rr rrrintstrrboolrobjectr% __classcell__)rs@rrr!s:I'+'+* 32 3!&#r/2 3#c(# 33s8$ 3 d| 36drrN)r)typingrrtelegramrtelegram._utils.defaultvaluertelegram._utils.typesrr"telegram.ext._handlers.basehandlerr #telegram.ext._utils._update_parsingr r telegram.ext._utils.typesr r rrrrr8s@&@$5-:M: T]? FCO <?r