+
    ÁFñj^E  ã            	       ó  € R t ^ RIHtHt ^ RIHt ^ RIHtHtH	t	H
t
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHtHt ]'       d   ^ R	IHtHt ^ R
IHtHtHt ^ RIH t  Rt!]! RRR7      t" ! R R]	]]]]3,          4      t#R# )z/This module contains the CallbackContext class.)Ú	AwaitableÚ	Generator)ÚMatch)ÚTYPE_CHECKINGÚAnyÚGenericÚNoReturnÚTypeVar©ÚCallbackQuery)ÚUpdate)Úwarn)ÚExtBot)ÚBDÚBTÚCDÚUD)ÚFutureÚQueue)ÚApplicationÚJobÚJobQueue)ÚCCTzihttps://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-dataÚSTz#CallbackContext[Any, Any, Any, Any])Úboundc                   ó<  a € ] tR t^.t o RtR(tR)V 3R lR llt]V 3R lR l4       t]V 3R lR l4       t	]	P                  V 3R	 lR
 l4       t	]V 3R lR l4       t]P                  V 3R lR l4       t]V 3R lR l4       t]P                  V 3R lR l4       tV 3R lR ltV 3R lR lt]R)V 3R lR ll4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR lt]V 3R lR  l4       t]V 3R! lR" l4       t]V 3R# lR$ l4       t]V 3R% lR& l4       tR'tV tR# )*ÚCallbackContexta
  
This is a context object passed to the callback called by :class:`telegram.ext.BaseHandler`
or by the :class:`telegram.ext.Application` in an error handler added by
:attr:`telegram.ext.Application.add_error_handler` or to the callback of a
:class:`telegram.ext.Job`.

Note:
    :class:`telegram.ext.Application` will create a single context for an entire update. This
    means that if you got 2 handlers in different groups and they both get called, they will
    receive the same :class:`CallbackContext` object (of course with proper attributes like
    :attr:`matches` differing). This allows you to add custom attributes in a lower handler
    group callback, and then subsequently access those attributes in a higher handler group
    callback. Note that the attributes on :class:`CallbackContext` might change in the future,
    so make sure to use a fairly unique name for the attributes.

Warning:
     Do not combine custom attributes with :paramref:`telegram.ext.BaseHandler.block` set to
     :obj:`False` or :attr:`telegram.ext.Application.concurrent_updates` set to
     :obj:`True`. Due to how those work, it will almost certainly execute the callbacks for an
     update out of order, and the attributes that you think you added will not be present.

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

1. The type of :attr:`bot`. Must be :class:`telegram.Bot` or a subclass of that class.
2. The type of :attr:`user_data` (if :attr:`user_data` is not :obj:`None`).
3. The type of :attr:`chat_data` (if :attr:`chat_data` is not :obj:`None`).
4. The type of :attr:`bot_data` (if :attr:`bot_data` is not :obj:`None`).

Examples:
    * :any:`Context Types Bot <examples.contexttypesbot>`
    * :any:`Custom Webhook Bot <examples.customwebhookbot>`

.. seealso:: :attr:`telegram.ext.ContextTypes.DEFAULT_TYPE`,
    :wiki:`Job Queue <Extensions---JobQueue>`

Args:
    application (:class:`telegram.ext.Application`): The application associated with this
        context.
    chat_id (:obj:`int`, optional): The ID of the chat associated with this object. Used
        to provide :attr:`chat_data`.

        .. versionadded:: 20.0
    user_id (:obj:`int`, optional): The ID of the user associated with this object. Used
        to provide :attr:`user_data`.

        .. versionadded:: 20.0
Attributes:
    coroutine (:term:`awaitable`): Optional. Only present in error handlers if the
        error was caused by an awaitable run with :meth:`Application.create_task` or a handler
        callback with :attr:`block=False <BaseHandler.block>`.
    matches (list[:meth:`re.Match <re.Match.expand>`]): Optional. If the associated update
        originated from a :class:`filters.Regex`, this will contain a list of match objects for
        every pattern where ``re.search(pattern, string)`` returned a match. Note that filters
        short circuit, so combined regex filters will not always be evaluated.
    args (list[:obj:`str`]): Optional. Arguments passed to a command if the associated update
        is handled by :class:`telegram.ext.CommandHandler`, :class:`telegram.ext.PrefixHandler`
        or :class:`telegram.ext.StringCommandHandler`. It contains a list of the words in the
        text after the command, using any whitespace string as a delimiter.
    error (:exc:`Exception`): Optional. The error that was raised. Only present when passed
        to an error handler registered with :attr:`telegram.ext.Application.add_error_handler`.
    job (:class:`telegram.ext.Job`): Optional. The job which originated this callback.
        Only present when passed to the callback of :class:`telegram.ext.Job` or in error
        handlers if the error is caused by a job.

        .. versionchanged:: 20.0
            :attr:`job` is now also present in error handlers if the error is caused by a job.

Nc          	      óL   <€ V ^8„  d   QhRS[ RRRS[R,          RS[R,          /# )é   ÚselfÚapplicationú$Application[BT, ST, UD, CD, BD, Any]Úchat_idNÚuser_id)r   Úint)ÚformatÚ__classdict__s   "€ÚS/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/ext/_callbackcontext.pyÚ__annotate__ÚCallbackContext.__annotate__€   s?   ø€ ÷ cñ cÙðcà;ðcñ �t•ðcñ �t•ñ	có    c                óp   € Wn         W n        W0n        R V n        R V n        R V n        R V n        R V n        R # )N)Ú_applicationÚ_chat_idÚ_user_idÚargsÚmatchesÚerrorÚjobÚ	coroutine)r   r    r"   r#   s   &&&&r'   Ú__init__ÚCallbackContext.__init__€   s9   € ð CNÔØ$+ŒØ$+ŒØ&*ˆŒ	Ø04ˆŒØ'+ˆŒ
Ø$(ˆŒØ^bˆŽr*   c                ó   <€ V ^8„  d   QhRR/# )r   Úreturnr!   © )r%   r&   s   "€r'   r(   r)   �   s   ø€ ÷ !ñ !ÐCñ !r*   c                ó   € V P                   # )zP:class:`telegram.ext.Application`: The application associated with this context.)r,   ©r   s   &r'   r    ÚCallbackContext.application�   s   € ð × Ñ Ð r*   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r7   )r   )r%   r&   s   "€r'   r(   r)   •   s   ø€ ÷ )ñ )™"ñ )r*   c                ó.   € V P                   P                  # )a)  :obj:`ContextTypes.bot_data`: Optional. An object that can be used to keep any data in.
For each update it will be the same :attr:`ContextTypes.bot_data`. Defaults to :obj:`dict`.

.. seealso:: :wiki:`Storing Bot, User and Chat Related Data            <Storing-bot%2C-user-and-chat-related-data>`
)r    Úbot_datar:   s   &r'   r?   ÚCallbackContext.bot_data”   s   € ð ×Ñ×(Ñ(Ð(r*   c                ó&   <€ V ^8„  d   QhRS[ RS[/# ©r   Ú_r7   ©Úobjectr   )r%   r&   s   "€r'   r(   r)   Ÿ   s   ø€ ÷ 
ñ 
™&ð 
¡Xñ 
r*   c                ó&   € \        R \         24      h)z0You can not assign a new value to bot_data, see ©ÚAttributeErrorÚ_STORING_DATA_WIKI©r   rC   s   &&r'   r?   r@   ž   s   € äØ>Ô?QÐ>RÐSó
ð 	
r*   c                ó.   <€ V ^8„  d   QhRS[ R,          /# ©r   r7   N)r   )r%   r&   s   "€r'   r(   r)   ¥   s   ø€ ÷ ñ ™2 �9ñ r*   c                óp   € V P                   e(   V P                  P                  V P                   ,          # R# )aœ  :obj:`ContextTypes.chat_data`: Optional. An object that can be used to keep any data in.
For each update from the same chat id it will be the same :obj:`ContextTypes.chat_data`.
Defaults to :obj:`dict`.

Warning:
    When a group chat migrates to a supergroup, its chat id will change and the
    ``chat_data`` needs to be transferred. For details see our
    :wiki:`wiki page <Storing-bot,-user-and-chat-related-data#chat-migration>`.

.. seealso:: :wiki:`Storing Bot, User and Chat Related Data            <Storing-bot%2C-user-and-chat-related-data>`

.. versionchanged:: 20.0
    The chat data is now also present in error handlers if the error is caused by a job.
N)r-   r,   Ú	chat_datar:   s   &r'   rN   ÚCallbackContext.chat_data¤   s,   € ð" �=‰=Ò$Ø×$Ñ$×.Ñ.¨t¯}©}Õ=Ð=Ùr*   c                ó&   <€ V ^8„  d   QhRS[ RS[/# rB   rD   )r%   r&   s   "€r'   r(   r)   º   ó   ø€ ÷ 
ñ 
™6ð 
¡hñ 
r*   c                ó&   € \        R \         24      h)z1You can not assign a new value to chat_data, see rG   rJ   s   &&r'   rN   rO   ¹   ó   € äØ?Ô@RÐ?SÐTó
ð 	
r*   c                ó.   <€ V ^8„  d   QhRS[ R,          /# rL   )r   )r%   r&   s   "€r'   r(   r)   À   s   ø€ ÷ ñ ™2 �9ñ r*   c                óp   € V P                   e(   V P                  P                  V P                   ,          # R# )a°  :obj:`ContextTypes.user_data`: Optional. An object that can be used to keep any data in.
For each update from the same user it will be the same :obj:`ContextTypes.user_data`.
Defaults to :obj:`dict`.

.. seealso:: :wiki:`Storing Bot, User and Chat Related Data            <Storing-bot%2C-user-and-chat-related-data>`

.. versionchanged:: 20.0
    The user data is now also present in error handlers if the error is caused by a job.
N)r.   r,   Ú	user_datar:   s   &r'   rV   ÚCallbackContext.user_data¿   s,   € ð �=‰=Ò$Ø×$Ñ$×.Ñ.¨t¯}©}Õ=Ð=Ùr*   c                ó&   <€ V ^8„  d   QhRS[ RS[/# rB   rD   )r%   r&   s   "€r'   r(   r)   Ð   rQ   r*   c                ó&   € \        R \         24      h)z1You can not assign a new value to user_data, see rG   rJ   s   &&r'   rV   rW   Ï   rS   r*   c                ó   <€ V ^8„  d   QhRR/# rL   r8   )r%   r&   s   "€r'   r(   r)   Õ   s   ø€ ÷ ñ  Dñ r*   c              ƒ  ó4  "  € V P                   P                  '       Edp   V P                   P                  P                  P                  '       d8   V P                   P                  P	                  V P                  4      G Rj  x€L
  V P                   P                  P                  P
                  '       dR   V P                  eD   V P                   P                  P                  V P                  V P
                  R7      G Rj  x€L
  V P                   P                  P                  P                  '       dV   V P                  eF   V P                   P                  P                  V P                  V P                  R7      G Rj  x€L
  R# R# R# R#  EL L� L5i)a¤  If :attr:`application` uses persistence, calls
:meth:`telegram.ext.BasePersistence.refresh_bot_data` on :attr:`bot_data`,
:meth:`telegram.ext.BasePersistence.refresh_chat_data` on :attr:`chat_data` and
:meth:`telegram.ext.BasePersistence.refresh_user_data` on :attr:`user_data`, if
appropriate.

Will be called by :meth:`telegram.ext.Application.process_update` and
:meth:`telegram.ext.Job.run`.

.. versionadded:: 13.6
N)r"   rN   )r#   rV   )r    ÚpersistenceÚ
store_datar?   Úrefresh_bot_datarN   r-   Úrefresh_chat_datarV   r.   Úrefresh_user_datar:   s   &r'   Úrefresh_dataÚCallbackContext.refresh_dataÕ   s7  é € ð ×Ñ×'×'Ñ'Ø×Ñ×+Ñ+×6Ñ6×?×?Ð?Ø×&Ñ&×2Ñ2×CÑCÀDÇMÁMÓR×RÐRØ×Ñ×+Ñ+×6Ñ6×@×@Ð@ÀTÇ]Á]ÒE^Ø×&Ñ&×2Ñ2×DÑDØ ŸM™MØ"Ÿn™nð Eó ÷ ð ð ×Ñ×+Ñ+×6Ñ6×@×@Ð@ÀTÇ]Á]ÒE^Ø×&Ñ&×2Ñ2×DÑDØ ŸM™MØ"Ÿn™nð Eó ÷ ò ñ F_Ñ@ñ (âRññ
ùsJ   ‚AFÁ2FÂFÂ3FÂ7AFÄFÄ3FÄ8AFÆFÆFÆFÆFc                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úcallback_queryr7   Nr
   )r%   r&   s   "€r'   r(   r)   ï   s   ø€ ÷ ñ ±ð À4ñ r*   c                óì   € \        V P                  \        4      '       dK   V P                  P                  f   \	        R4      hV P                  P                  P                  V4       R# \	        R4      h)ad  
Deletes the cached data for the specified callback query.

.. versionadded:: 13.6

Note:
    Will *not* raise exceptions in case the data is not found in the cache.
    *Will* raise :exc:`KeyError` in case the callback query can not be found in the cache.

.. seealso:: :wiki:`Arbitrary callback_data <Arbitrary-callback_data>`

Args:
    callback_query (:class:`telegram.CallbackQuery`): The callback query.

Raises:
    KeyError | RuntimeError: :exc:`KeyError`, if the callback query can not be found in
        the cache and :exc:`RuntimeError`, if the bot doesn't allow for arbitrary
        callback data.
NzGThis telegram.ext.ExtBot instance does not use arbitrary callback data.z8telegram.Bot does not allow for arbitrary callback data.)Ú
isinstanceÚbotr   Úcallback_data_cacheÚRuntimeErrorÚ	drop_data)r   rd   s   &&r'   Údrop_callback_dataÚ"CallbackContext.drop_callback_dataï   s_   € ô( �d—h‘h¤×'Ò'Ø�x‰x×+Ñ+Ò3Ü"Ø]óð ð �H‰H×(Ñ(×2Ñ2°>ÖBäØJóð r*   c                ó�   <€ V ^8„  d   QhRS[ R,          RS[RS[RRRRR	S[R
RS[3,          S[S[,          ,          R,          RR/# )r   Úclsr   Úupdater1   r    z%Application[BT, CCT, UD, CD, BD, Any]r2   zJob[Any] | Noner3   zFuture[object] | NoneNr7   )ÚtyperE   Ú	Exceptionr   r   r   )r%   r&   s   "€r'   r(   r)     so   ø€ ÷ 0ñ 0Ù�%�[ð0áð0ñ ð0ð =ð	0ð
 ð0ñ Ð4°d¹CÐ?Õ@Á9ÉSÅ>ÕQÐTXÕXð0ð 
ñ0r*   c                ó†   € Ve   V P                  W4      pMVe   V P                  WC4      pMV ! V4      pW&n        WVn        V# )ao  
Constructs an instance of :class:`telegram.ext.CallbackContext` to be passed to the error
handlers.

.. seealso:: :meth:`telegram.ext.Application.add_error_handler`

.. versionchanged:: 20.0
    Removed arguments ``async_args`` and ``async_kwargs``.

Args:
    update (:obj:`object` | :class:`telegram.Update`): The update associated with the
        error. May be :obj:`None`, e.g. for errors in job callbacks.
    error (:obj:`Exception`): The error.
    application (:class:`telegram.ext.Application`): The application associated with this
        context.
    job (:class:`telegram.ext.Job`, optional): The job associated with the error.

        .. versionadded:: 20.0
    coroutine (:term:`awaitable`, optional): The awaitable associated
        with this error if the error was caused by a coroutine run with
        :meth:`Application.create_task` or a handler callback with
        :attr:`block=False <BaseHandler.block>`.

        .. versionadded:: 20.0

        .. versionchanged:: 20.2
            Accepts :class:`asyncio.Future` and generator-based coroutine functions.
Returns:
    :class:`telegram.ext.CallbackContext`
)Úfrom_updateÚfrom_jobr1   r3   )rn   ro   r1   r    r2   r3   r   s   &&&&&& r'   Ú
from_errorÚCallbackContext.from_error  sE   € ðP ÒØ—?‘? 6Ó7‰DØŠ_Ø—<‘< Ó1‰Dá�{Ó#ˆDàŒ
Ø"ŒØˆr*   c                ó<   <€ V ^8„  d   QhRS[ R,          RS[RRRR/# )r   rn   r   ro   r    ú)Application[Any, CCT, Any, Any, Any, Any]r7   )rp   rE   )r%   r&   s   "€r'   r(   r)   B  s6   ø€ ÷  ñ  Ù�%�[ð áð ð Að ð 
ñ	 r*   c                óÚ   € \        V\        4      '       dO   VP                  pVP                  pV'       d   VP                  MRpV'       d   VP                  MRpV ! W%VR7      # V ! V4      # )aƒ  
Constructs an instance of :class:`telegram.ext.CallbackContext` to be passed to the
handlers.

.. seealso:: :meth:`telegram.ext.Application.add_handler`

Args:
    update (:obj:`object` | :class:`telegram.Update`): The update.
    application (:class:`telegram.ext.Application`): The application associated with this
        context.

Returns:
    :class:`telegram.ext.CallbackContext`
N©r"   r#   )rf   r   Úeffective_chatÚeffective_userÚid)rn   ro   r    ÚchatÚuserr"   r#   s   &&&    r'   rs   ÚCallbackContext.from_updateA  sY   € ô( �fœf×%Ò%Ø×(Ñ(ˆDØ×(Ñ(ˆDç!%�d—g’g¨4ˆGß!%�d—g’g¨4ˆGá�{¸WÔEÐEÙ�;ÓÐr*   c                ó:   <€ V ^8„  d   QhRS[ R,          RRRRRR/# )r   rn   r   r2   zJob[CCT]r    rx   r7   )rp   )r%   r&   s   "€r'   r(   r)   `  s6   ø€ ÷ ñ Ù�%�[ðàðð Aðð 
ñ	r*   c                óN   € V ! W!P                   VP                  R7      pWn        V# )aa  
Constructs an instance of :class:`telegram.ext.CallbackContext` to be passed to a
job callback.

.. seealso:: :meth:`telegram.ext.JobQueue`

Args:
    job (:class:`telegram.ext.Job`): The job.
    application (:class:`telegram.ext.Application`): The application associated with this
        context.

Returns:
    :class:`telegram.ext.CallbackContext`
rz   )r"   r#   r2   )rn   r2   r    r   s   &&& r'   rt   ÚCallbackContext.from_job_  s"   € ñ( �;¯©¸S¿[¹[ÔIˆØŒØˆr*   c                ó:   <€ V ^8„  d   QhRS[ S[S[3,          RR/# )r   Údatar7   N)ÚdictÚstrrE   )r%   r&   s   "€r'   r(   r)   w  s$   ø€ ÷ &ñ &™4¡¡V Õ,ð &°ñ &r*   c                óP   € VP                  4        F  w  r#\        WV4       K  	  R# )znUpdates ``self.__slots__`` with the passed data.

Args:
    data (dict[:obj:`str`, :obj:`object`]): The data.
N)ÚitemsÚsetattr)r   r…   ÚkeyÚvalues   &&  r'   ro   ÚCallbackContext.updatew  s    € ð Ÿ*™*ž,‰JˆCÜ�D˜uÖ%ó 'r*   c                ó    <€ V ^8„  d   QhRS[ /# r=   )r   )r%   r&   s   "€r'   r(   r)   �  s   ø€ ÷ %ñ %‘Rñ %r*   c                ó.   € V P                   P                  # )z<:class:`telegram.Bot`: The bot associated with this context.)r,   rg   r:   s   &r'   rg   ÚCallbackContext.bot€  s   € ð × Ñ ×$Ñ$Ð$r*   c                ó   <€ V ^8„  d   QhRR/# )r   r7   zJobQueue[ST] | Noner8   )r%   r&   s   "€r'   r(   r)   †  s   ø€ ÷ ,ñ ,Ð0ñ ,r*   c                óx   € V P                   P                  f   \        R^R7       V P                   P                  # )zž
:class:`telegram.ext.JobQueue`: The :class:`JobQueue` used by the
:class:`telegram.ext.Application`.

.. seealso:: :wiki:`Job Queue <Extensions---JobQueue>`
zqNo `JobQueue` set up. To use `JobQueue`, you must install PTB via `pip install "python-telegram-bot[job-queue]"`.)Ú
stacklevel)r,   Ú
_job_queuer   r:   s   &r'   Ú	job_queueÚCallbackContext.job_queue…  s;   € ð ×Ñ×'Ñ'Ò/ÜðBàõð
 × Ñ ×+Ñ+Ð+r*   c                ó   <€ V ^8„  d   QhRR/# )r   r7   zQueue[object]r8   )r%   r&   s   "€r'   r(   r)   –  s   ø€ ÷ .ñ .˜oñ .r*   c                ó.   € V P                   P                  # )zÂ
:class:`asyncio.Queue`: The :class:`asyncio.Queue` instance used by the
    :class:`telegram.ext.Application` and (usually) the :class:`telegram.ext.Updater`
    associated with this context.

)r,   Úupdate_queuer:   s   &r'   r™   ÚCallbackContext.update_queue•  s   € ð × Ñ ×-Ñ-Ð-r*   c                ó>   <€ V ^8„  d   QhRS[ S[,          R,          /# rL   )r   r‡   )r%   r&   s   "€r'   r(   r)      s   ø€ ÷ 	ñ 	‘u™S•z DÕ(ñ 	r*   c                óZ   €  V P                   ^ ,          #   \        \        3 d     R# i ; i)zÂ
:meth:`re.Match <re.Match.expand>`: The first match from :attr:`matches`.
    Useful if you are only filtering using a single regex filter.
    Returns :obj:`None` if :attr:`matches` is empty.
N)r0   Ú
IndexErrorÚ	TypeErrorr:   s   &r'   ÚmatchÚCallbackContext.matchŸ  s,   € ð	Ø—<‘< •?Ð"øÜœIÐ&ô 	Úð	ús   ‚ •*©*)r,   r-   r.   r/   r3   r1   r2   r0   )	Ú__dict__r,   r-   r.   r/   r3   r1   r2   r0   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r4   Úpropertyr    r?   ÚsetterrN   rV   ra   rk   Úclassmethodru   rs   rt   ro   rg   r•   r™   rŸ   Ú__static_attributes__Ú__classdictcell__)r&   s   @r'   r   r   .   sk  ø‡ € ñCðJ
€I÷cò cð ÷!ó ð!ð ÷)ó ð)ð ‡_�_÷
ó ð
ð
 ÷ó ðð( ×Ñ÷
ó ð
ð
 ÷ó ðð ×Ñ÷
ó ð
÷
ð ÷4ð ð> ÷0ñ 0ó ð0ðd ÷ ó ð ð: ÷ó ð÷.&ð &ð ÷%ó ð%ð ÷,ó ð,ð ÷.ó ð.ð ÷	ó ö	r*   r   N)$r¦   Úcollections.abcr   r   Úrer   Útypingr   r   r   r   r	   Útelegram._callbackqueryr   Útelegram._updater   Útelegram._utils.warningsr   Útelegram.ext._extbotr   Útelegram.ext._utils.typesr   r   r   r   Úasyncior   r   Útelegram.extr   r   r   r   rI   r   r   r8   r*   r'   Ú<module>r·      sk   ðñ& 6ç 0Ý ß AÕ Aå 1Ý #Ý )Ý 'ß 4Ó 4çß%ç7Ñ7Ý-ð6ð ñ ˆTÐ>Ô?€ô{�g˜b " b¨"˜nÕ-ö {r*   