
    Yi|                         S r SSKJrJrJrJrJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  SSKJrJr  \(       a  SS	KJr  \" S
5      r " S S\\\\4   5      rg)z.This module contains the MessageHandler class.    )TYPE_CHECKINGAnyOptionalTypeVarUnion)Update)DEFAULT_TRUE)DVTypefilters)BaseHandler)CCTHandlerCallback)ApplicationRTc                      ^  \ rS rSrSrSr\4SSS\\R                     S\
\\\4   S\\   4U 4S	 jjjrS
\S\\\\\\\   4   4      4S jrS\S
\SSS\\\\\\4   4      SS4
S jrSrU =r$ )MessageHandler#   a  Handler 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 <Extensions---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   selfzMessageHandler[CCT, RT]r   callbackblockc                 `   > [         TU ]  X#S9  Ub  UU l        g [        R                  U l        g )N)r   )super__init__filters_moduleALLr   )r   r   r   r   	__class__s       P/app/.venv/lib/python3.13/site-packages/telegram/ext/_handlers/messagehandler.pyr   MessageHandler.__init__M   s4     	/*G 	0>0B0B 	    updatereturnc                 v    [        U[        5      (       a$  U R                  R                  U5      =(       d    S$ g)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)
isinstancer   r   check_update)r   r!   s     r   r%   MessageHandler.check_updateX   s.     ff%%<<,,V4==r    contextapplicationz)Application[Any, CCT, Any, Any, Any, Any]check_resultNc                 R    [        U[        5      (       a  UR                  U5        gg)zEAdds possible output of data filters to the :class:`CallbackContext`.N)r$   dictr!   )r   r'   r!   r(   r)   s        r   collect_additional_context)MessageHandler.collect_additional_contextf   s"     lD))NN<( *r    )__name__
__module____qualname____firstlineno____doc__	__slots__r	   r   r   
BaseFilterr   r   r   r   r
   boolr   objectr   r+   strlistr   r%   r,   __static_attributes____classcell__)r   s   @r   r   r   #   s    %N I +		
'	
.334	
 "&#r/2	
 d|		
 	
6 huT4TRUYCW=W7X.Y 	)	) 	) A		)
 uT4V+<%<=>	) 
	) 	)r    r   N)r2   typingr   r   r   r   r   telegramr   telegram._utils.defaultvaluer	   telegram._utils.typesr
   telegram.extr   r   "telegram.ext._handlers.basehandlerr   telegram.ext._utils.typesr   r   r   r   r    r    r   <module>rC      sJ   & 5 ? ?  5 ( 2 : :(T]L)[b1 L)r    