+
    ÁFñj¾  ã                   óÌ   € R t ^ RIt^ RIHtHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht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 R]]]]3,          4      tR# )z-This module contains the PrefixHandler class.N)ÚTYPE_CHECKINGÚAnyÚTypeVar)ÚUpdate)ÚDEFAULT_TRUE)ÚSCTÚDVType)Úfilters)ÚBaseHandler)ÚCCTÚHandlerCallback)ÚApplicationÚRTc                   ór   a a€ ] tR t^%t oRtR	tR]3V3R lV 3R llltV3R lR ltV3R lR lt	R	t
VtV ;t# )
ÚPrefixHandleraÀ  Handler class to handle custom prefix commands.

This is an intermediate handler between :class:`MessageHandler` and :class:`CommandHandler`.
It supports configurable commands with the same options as :class:`CommandHandler`. It will
respond to every combination of :paramref:`prefix` and :paramref:`command`.
It will add a :obj:`list` to the :class:`CallbackContext` named :attr:`CallbackContext.args`,
containing a list of strings, which is the text following the command split on single or
consecutive whitespace characters.

Examples:

    Single prefix and command:

    .. code:: python

        PrefixHandler("!", "test", callback)  # will respond to '!test'.

    Multiple prefixes, single command:

    .. code:: python

        PrefixHandler(["!", "#"], "test", callback)  # will respond to '!test' and '#test'.

    Multiple prefixes and commands:

    .. code:: python

        PrefixHandler(
            ["!", "#"], ["test", "help"], callback
        )  # will respond to '!test', '#test', '!help' and '#help'.


By default, the handler listens to messages as well as edited messages. To change this behavior
use :attr:`~filters.UpdateType.EDITED_MESSAGE <telegram.ext.filters.UpdateType.EDITED_MESSAGE>`

Note:
    * :class:`PrefixHandler` does *not* handle (edited) channel posts.

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.

.. versionchanged:: 20.0

    * :class:`PrefixHandler` is no longer a subclass of :class:`CommandHandler`.
    * Removed the attributes ``command`` and ``prefix``. Instead, the new :attr:`commands`
      contains all commands that this handler listens to as a :class:`frozenset`, which
      includes the prefixes.
    * Updating the prefixes and commands this handler listens to is no longer possible.

Args:
    prefix (:obj:`str` | Collection[:obj:`str`]):
        The prefix(es) that will precede :paramref:`command`.
    command (:obj:`str` | Collection[:obj:`str`]):
        The command or list of commands this handler should listen for. Case-insensitive.
    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`.
    filters (:class:`telegram.ext.filters.BaseFilter`, optional): 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 :keyword:`and`, ``|`` for :keyword:`or`, ``~`` for :keyword:`not`)
    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:
    commands (frozenset[:obj:`str`]): The commands that this handler will listen for, i.e. the
        combinations of :paramref:`prefix` and :paramref:`command`.
    callback (:term:`coroutine function`): The callback function for this handler.
    filters (:class:`telegram.ext.filters.BaseFilter`): Optional. Only allow updates with these
        Filters.
    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`.

Nc                ó¨   <€ V ^8„  d   QhRRRS[ S[,          RS[ S[,          RS[S[S[S[3,          RS[P                  R,          RS[S[	,          /# )	é   ÚselfzPrefixHandler[CCT, RT]ÚprefixÚcommandÚcallbackr	   NÚblock)
r   Ústrr   r   r   r   Úfilters_moduleÚ
BaseFilterr   Úbool)ÚformatÚ__classdict__s   "€ÚZ/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/ext/_handlers/prefixhandler.pyÚ__annotate__ÚPrefixHandler.__annotate__~   sg   ø€ ÷ 
ñ 
Ø&ð
á‘C•ð
ñ ‘S•ð
ñ "¡&©#©r /Õ2ð	
ñ
  ×*Ñ*¨TÕ1ð
ñ ‘d�|ñ
ó    c                ó  <€ \         S	V `  W5R 7       \        V\        4      '       d   VP	                  4       0MV Uu0 uF  qfP	                  4       kK  	  upp\        V\        4      '       d   VP	                  4       0MV Uu0 uF  qfP	                  4       kK  	  upp\        R \        P                  ! Wx4       4       4      V n        Ve
   VV n        R# \        P                  P                  V n        R# u upi u upi ))r   r   c              3   ó6   "  € T F  w  rW,           x € K  	  R # 5i)N© )Ú.0ÚpÚcs   &  r   Ú	<genexpr>Ú)PrefixHandler.__init__.<locals>.<genexpr>Œ   s   é € ð 2
ÙC‘d�aˆA�EŠEÓCùs   ‚N)ÚsuperÚ__init__Ú
isinstancer   ÚlowerÚ	frozensetÚ	itertoolsÚproductÚcommandsr   Ú
UpdateTypeÚMESSAGESr	   )
r   r   r   r   r	   r   ÚxÚprefixesr1   Ú	__class__s
   &&&&&&   €r   r+   ÚPrefixHandler.__init__~   sÐ   ø€ ô 	‰Ñ (ÐÔ8ä'1°&¼#×'>Ò'>�F—L‘L“NÑ#ÑX^ÓD_ÑX^ÐSTÇWÁWÆYÑX^ÑD_ˆä(2°7¼C×(@Ò(@�G—M‘M“OÑ$ÑZaÓFbÑZaÐUVÇwÁwÆyÑZaÑFbˆä(1ñ 2
Ü'×/Ò/°ÔCó2
ó )
ˆŒð Ò*ˆGð 	ŽÜ0>×0IÑ0I×0RÑ0Rð 	Žùò E`ùâFbs   ½C7ÂC<c          
      óž   <€ V ^8„  d   QhRS[ RS[S[S[S[,          S[S[S[S[3,          ,          R,          3,          ,          R,          /# )r   ÚupdateÚreturnN)Úobjectr   ÚtupleÚlistr   Údictr   )r   r   s   "€r   r   r    “   sG   ø€ ÷ ñ Ùðá	‘‘d™3•i¡©©S±#¨X­Õ!6¸Õ!=Ð=Õ>Õ	>ÀÕ	Eñr!   c                óv  € \        V\        4      '       d£   VP                  '       d‘   VP                  pVP                  '       ds   VP                  P	                  4       pV^ ,          P                  4       V P                  9  d   R# V P                  P                  V4      pV'       d   VR,          V3# R# R# )zßDetermines whether an update should be passed to this handler's :attr:`callback`.

Args:
    update (:class:`telegram.Update` | :obj:`object`): Incoming update.

Returns:
    :obj:`list`: The list of args for the handler.

N:é   NNF)	r,   r   Úeffective_messageÚtextÚsplitr-   r1   r	   Úcheck_update)r   r9   ÚmessageÚ	text_listÚfilter_results   &&   r   rD   ÚPrefixHandler.check_update“   sŠ   € ô �fœf×%Ò%¨&×*B×*BÐ*BØ×.Ñ.ˆGà�|�|ˆ|Ø#ŸL™L×.Ñ.Ó0�	Ø˜Q•<×%Ñ%Ó'¨t¯}©}Ô<ÙØ $§¡× 9Ñ 9¸&Ó A�ß Ø$ R�=¨-Ð7Ð7ÙÙr!   c                óx   <€ V ^8„  d   QhRS[ RS[RRRS[S[S[S[,          S[3,          ,          R,          RR/# )r   Úcontextr9   Úapplicationz)Application[Any, CCT, Any, Any, Any, Any]Úcheck_resultNr:   )r   r   r   r<   r=   r   )r   r   s   "€r   r   r    ¬   sU   ø€ ÷ 0ñ 0áð0ñ ð0ð Að	0ñ
 ™U¡4©¥9©d ?Õ3Õ3°dÕ:ð0ð 
ñ0r!   c                óÀ   € \        V\        4      '       dH   V^ ,          Vn        \        V^,          \        4      '       d   VP	                  V^,          4       R# R# R# )z£Add text after the command to :attr:`CallbackContext.args` as list, split on single
whitespaces and add output of data filters to :attr:`CallbackContext` as well.
N)r,   r<   Úargsr>   r9   )r   rJ   r9   rK   rL   s   &&&&&r   Úcollect_additional_contextÚ(PrefixHandler.collect_additional_context¬   sG   € ô �l¤E×*Ò*Ø'¨�?ˆGŒLÜ˜, q�/¬4×0Ò0Ø—‘˜|¨A�Ö/ñ 1ñ +r!   )r1   r	   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r   r+   rD   rO   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r6   r   s   @@r   r   r   %   s>   ù‡ € ñSðl (€Ið 59Ø*÷
õ 
÷*ð ÷20÷ 0ð 0r!   r   )rU   r/   Útypingr   r   r   Útelegramr   Útelegram._utils.defaultvaluer   Útelegram._utils.typesr   r   Útelegram.extr	   r   Ú"telegram.ext._handlers.basehandlerr
   Útelegram.ext._utils.typesr   r   r   r   r   r$   r!   r   Ú<module>ra      sM   ðñ& 4ã ß .Ñ .å Ý 5ß -Ý 2Ý :ß :çÝ(áˆTƒ]€ôT0�K ¨¨R Õ0ö T0r!   