+
    ÁFñj   ã            	       óÎ   € R t ^ RIHtHt ^ RIHtHtHtHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHtHt ]'       d   ^ RIHt ]! R4      t]! R	4      t ! R
 R]]]]]3,          4      tR# )zLThis module contains the base class for handlers as used by the Application.)ÚABCÚabstractmethod)ÚTYPE_CHECKINGÚAnyÚGenericÚTypeVar)ÚDEFAULT_TRUE)Úbuild_repr_with_selected_attrs)ÚDVType)ÚCCTÚHandlerCallback)ÚApplicationÚRTÚUTc                   ó’   a € ] tR t^$t o RtRt]3V 3R lR lltV 3R lR lt]	V 3R lR l4       t
V 3R lR	 ltV 3R
 lR ltRtV tR# )ÚBaseHandlera/	  The base class for all update handlers. Create custom handlers by inheriting from it.

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.

This class is a :class:`~typing.Generic` class and accepts three type variables:

1. The type of the updates that this handler will handle. Must coincide with the type of the
   first argument of :paramref:`callback`. :meth:`check_update` must only accept
   updates of this type.
2. The type of the second argument of :paramref:`callback`. Must coincide with the type of the
   parameters :paramref:`handle_update.context` and
   :paramref:`collect_additional_context.context` as well as the second argument of
   :paramref:`callback`. Must be either :class:`~telegram.ext.CallbackContext` or a subclass
   of that class.

   .. tip::
       For this type variable, one should usually provide a :class:`~typing.TypeVar` that is
       also used for the mentioned method arguments. That way, a type checker can check whether
       this handler fits the definition of the :class:`~Application`.
3. The return type of the :paramref:`callback` function accepted by this handler.

.. seealso:: :wiki:`Types of Handlers <Types-of-Handlers>`

.. versionchanged:: 20.0

    * The attribute ``run_async`` is now :paramref:`block`.
    * This class was previously named ``Handler``.

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`.
    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 callback will run in a blocking way.

c                óT   <€ V ^8„  d   QhRRRS[ S[S[S[3,          RS[S[,          /# )é   ÚselfzBaseHandler[UT, CCT, RT]ÚcallbackÚblock)r   r   r   r   r
   Úbool)ÚformatÚ__classdict__s   "€ÚX/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/ext/_handlers/basehandler.pyÚ__annotate__ÚBaseHandler.__annotate__]   s6   ø€ ÷ )ñ )Ø(ð)á!¡"¡c©2 +Õ.ð)ñ ‘d�|ñ)ó    c                ó   € Wn         W n        R # )N)r   r   )r   r   r   s   &&&r   Ú__init__ÚBaseHandler.__init__]   s   € ð
 7?ŒØ#(Ž
r   c                ó    <€ V ^8„  d   QhRS[ /# )r   Úreturn)Ústr)r   r   s   "€r   r   r   e   s   ø€ ÷ Lñ L™#ñ Lr   c                ó”   €  V P                   P                  p\	        WR7      #   \         d    \        T P                   4      p L.i ; i)zùGive a string representation of the handler in the form ``ClassName[callback=...]``.

As this class doesn't implement :meth:`object.__str__`, the default implementation
will be used, which is equivalent to :meth:`__repr__`.

Returns:
    :obj:`str`
)r   )r   Ú__qualname__ÚAttributeErrorÚreprr	   )r   Úcallback_names   & r   Ú__repr__ÚBaseHandler.__repr__e   sB   € ð	0Ø ŸM™M×6Ñ6ˆMô .¨dÔKÐKøô ô 	0Ü  §¡Ó/ŠMð	0ús   ‚$ ¤ AÁAc                óD   <€ V ^8„  d   QhRS[ RS[S[ ,          R,          /# )r   Úupdater"   N)Úobjectr   )r   r   s   "€r   r   r   u   s$   ø€ ÷ ñ ¡6ð ©d±V­m¸dÕ.Bñ r   c                ó   € R# )a`  
This method is called to determine if an update should be handled by
this handler instance. It should always be overridden.

Note:
    Custom updates types can be handled by the application. Therefore, an implementation of
    this method should always check the type of :paramref:`update`.

Args:
    update (:obj:`object` | :class:`telegram.Update`): The update to be tested.

Returns:
    Either :obj:`None` or :obj:`False` if the update should not be handled. Otherwise an
    object that will be passed to :meth:`handle_update` and
    :meth:`collect_additional_context` when the update gets handled.

N© )r   r,   s   &&r   Úcheck_updateÚBaseHandler.check_updatet   ó   ‚ r   c          
      ó6   <€ V ^8„  d   QhRS[ RRRS[RS[RS[/# )r   r,   Úapplicationú)Application[Any, CCT, Any, Any, Any, Any]Úcheck_resultÚcontextr"   )r   r-   r   r   )r   r   s   "€r   r   r   ˆ   s>   ø€ ÷ 4ñ 4áð4ð Að4ñ ð	4ñ
 ð4ñ 
ñ4r   c              ƒ  ód   "  € V P                  WAW#4       V P                  W4      G Rj  x€L
 #  L5i)a¸  
This method is called if it was determined that an update should indeed
be handled by this instance. Calls :attr:`callback` along with its respectful
arguments. To work with the :class:`telegram.ext.ConversationHandler`, this method
returns the value returned from :attr:`callback`.
Note that it can be overridden if needed by the subclassing handler.

Args:
    update (:obj:`str` | :class:`telegram.Update`): The update to be handled.
    application (:class:`telegram.ext.Application`): The calling application.
    check_result (:class:`object`): The result from :meth:`check_update`.
    context (:class:`telegram.ext.CallbackContext`): The context as provided by
        the application.

N)Úcollect_additional_contextr   )r   r,   r4   r6   r7   s   &&&&&r   Úhandle_updateÚBaseHandler.handle_updateˆ   s,   é € ð, 	×'Ñ'¨¸ÔSØ—]‘] 6Ó3×3Ð3Ñ3ùs   ‚'0©.ª0c          
      ó4   <€ V ^8„  d   QhRS[ RS[RRRS[RR/# )r   r7   r,   r4   r5   r6   r"   N)r   r   r   )r   r   s   "€r   r   r   ¡   s>   ø€ ÷ ñ áðñ ðð Að	ñ
 ðð 
ñr   c                ó   € R# )ax  Prepares additional arguments for the context. Override if needed.

Args:
    context (:class:`telegram.ext.CallbackContext`): The context object.
    update (:class:`telegram.Update`): The update to gather chat/user id from.
    application (:class:`telegram.ext.Application`): The calling application.
    check_result: The result (return value) from :meth:`check_update`.

Nr/   )r   r7   r,   r4   r6   s   &&&&&r   r9   Ú&BaseHandler.collect_additional_context¡   r2   r   )r   r   N)Ú__name__Ú
__module__r%   Ú__firstlineno__Ú__doc__Ú	__slots__r   r   r)   r   r0   r:   r9   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r   $   sU   ø‡ € ñ1ðf€Ið +÷)ò )÷Lð Lð ÷ó ð÷&4ð 4÷2ö r   r   N)rB   Úabcr   r   Útypingr   r   r   r   Útelegram._utils.defaultvaluer   Útelegram._utils.reprr	   Útelegram._utils.typesr
   Útelegram.ext._utils.typesr   r   Útelegram.extr   r   r   r   r/   r   r   Ú<module>rM      sS   ðñ& Sç #ß 7Ó 7å 5Ý ?Ý (ß :çÝ(áˆTƒ]€ÙˆTƒ]€ôL�#�w˜r 3¨˜{Õ+ö Lr   