L i}dZddlmZmZmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZddlmZmZerdd l mZed ZGd d eeeefZy )z.This module contains the MessageHandler class.) TYPE_CHECKINGAnyOptionalTypeVarUnion)Update) DEFAULT_TRUE)DVTypefilters) BaseHandler)CCTHandlerCallback) ApplicationRTc eZdZdZdZefdddeejde e e e fde effd Zd ed eeeeeeefffd Zd e d e d ddeeeeeeffd df dZxZS)MessageHandleraHandler class to handle Telegram messages. They might contain text, media or status updates. 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. Args: filters (:class:`telegram.ext.filters.BaseFilter`): A filter inheriting from :class:`telegram.ext.filters.BaseFilter`. Standard filters can be found in :mod:`telegram.ext.filters`. Filters can be combined using bitwise operators (& for and, | for or, ~ for not). Passing :obj:`None` is a shortcut to passing :class:`telegram.ext.filters.ALL`. .. seealso:: :wiki:`Advanced Filters ` 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`. 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: filters (:class:`telegram.ext.filters.BaseFilter`): Only allow updates with these Filters. See :mod:`telegram.ext.filters` for a full list of all available filters. 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`. r selfzMessageHandler[CCT, RT]r callbackblockcft||||||_ytj|_y)N)r)super__init__filters_moduleALLr )rr rr __class__s k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_handlers/messagehandler.pyrzMessageHandler.__init__Ns6 /*G 0>0B0B updatereturncbt|tr|jj|xsdSy)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` FN) isinstancerr check_update)rrs rr#zMessageHandler.check_updateYs+ ff %<<,,V4= =rcontext applicationz)Application[Any, CCT, Any, Any, Any, Any] check_resultNcHt|tr|j|yy)zEAdds possible output of data filters to the :class:`CallbackContext`.N)r"dictr)rr$rr%r&s rcollect_additional_contextz)MessageHandler.collect_additional_contextgs lD ) NN< ( *r)__name__ __module__ __qualname____doc__ __slots__r rr BaseFilterrrrrr boolrobjectrr(strlistrr#r) __classcell__)rs@rrr$s%NI +  '  .334  "&#r/2  d|   6 huT4TRUYCW=W7X.Y  ) ) )A ) uT4V +<%<=> )  )rrN)r-typingrrrrrtelegramrtelegram._utils.defaultvaluer telegram._utils.typesr telegram.extr r"telegram.ext._handlers.basehandlerr telegram.ext._utils.typesrrrrrrrr=sJ&5??5(2::( T]L)[b1L)r