L idZddlmZddlmZddlmZddlmZm Z ddl m Z ddl m Z mZddlmZmZmZGd d e eeefZy ) z2This module contains the PaidMediaPurchased class.)Optional)Update) DEFAULT_TRUE)SCTDVType) BaseHandler) parse_chat_idparse_username)CCTRTHandlerCallbackc ~eZdZdZdZddefdddeeee fde e e de e e d eef fd Zd ed efd ZxZS)PaidMediaPurchasedHandleraiHandler class to handle Telegram :attr:`purchased paid media `. .. versionadded:: 21.6 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"PaidMediaPurchasedHandler[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/paidmediapurchasedhandler.pyrz"PaidMediaPurchasedHandler.__init__Bs/ /&w/(2updatereturnc t|tr |jsy|js |jsy|jj j |jvry|jj j|jvS)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) isinstancerpurchased_paid_mediarr from_useridr)rrs r check_updatez&PaidMediaPurchasedHandler.check_updateNsk&&)1L1L~~doo  & & 0 0 3 3t~~ E**44==PPr)__name__ __module__ __qualname____doc__ __slots__rr rr r rrintstrrboolrobjectr$ __classcell__)rs@rrrs:I'+'+* 32 3!&#r/2 3#c(# 33s8$ 3 d| 3Q6QdQrrN)r(typingrtelegramrtelegram._utils.defaultvaluertelegram._utils.typesrr"telegram.ext._handlers.basehandlerr#telegram.ext._utils._update_parsingr r telegram.ext._utils.typesr r r rrrr7s=&95-:M>>@Q FCO <@Qr