
    Yi                     v    S r SSKJrJr  SSKJr  SSKJr  SSKJ	r	J
r
  SSKJrJrJr   " S S\\\\4   5      rg	)
z0This module contains the ChatBoostHandler class.    )FinalOptional)Update)BaseHandler)parse_chat_idparse_username)CCTRTHandlerCallbackc                      ^  \ rS rSr% SrSrSr\\   \	S'    Sr
\\   \	S'    Sr\\   \	S	'    \S
S
S4SSS\\\\4   S\S\\   S\\   S\4U 4S jjjrS\S\4S jrSrU =r$ )ChatBoostHandler   a  
Handler class to handle Telegram updates that contain a chat boost.

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.

.. versionadded:: 20.8

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`.
    chat_boost_types (:obj:`int`, optional): Pass one of
        :attr:`CHAT_BOOST`, :attr:`REMOVED_CHAT_BOOST` or
        :attr:`ANY_CHAT_BOOST` to specify if this handler should handle only updates with
        :attr:`telegram.Update.chat_boost`,
        :attr:`telegram.Update.removed_chat_boost` or both. Defaults to
        :attr:`CHAT_BOOST`.
    chat_id (:obj:`int` | Collection[:obj:`int`], optional): Filters reactions to allow
        only those which happen in the specified chat ID(s).
    chat_username (:obj:`str` | Collection[:obj:`str`], optional): Filters reactions to allow
        only those which happen in the specified username(s).
    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.
    chat_boost_types (:obj:`int`): Optional. Specifies if this handler should handle only
        updates with :attr:`telegram.Update.chat_boost`,
        :attr:`telegram.Update.removed_chat_boost` or both.
    block (:obj:`bool`): Determines whether the callback will run in a blocking way.
)	_chat_ids_chat_usernameschat_boost_types
CHAT_BOOSTr   REMOVED_CHAT_BOOST   ANY_CHAT_BOOSTNTselfzChatBoostHandler[CCT, RT]callbackr   chat_idchat_usernameblockc                 l   > [         TU ]  XS9  X l        [        U5      U l        [        U5      U l        g )N)r   )super__init__r   r   r   r   r   )r   r   r   r   r   r   	__class__s         R/app/.venv/lib/python3.13/site-packages/telegram/ext/_handlers/chatboosthandler.pyr   ChatBoostHandler.__init__V   s4     	/%5&w/-m<    updatereturnc                    [        U[        5      (       d  gUR                  (       d  UR                  (       d  gU R                  U R
                  :X  a  UR                  (       d  gU R                  U R                  :X  a  UR                  (       d  g[        U R                  U R                  45      (       d  gUR                  =n(       a  UR                  OSnU(       a  UR                  OSn[        U R                  =(       a    X0R                  ;   5      =(       d*    [        U R                  =(       a    X@R                  ;   5      $ )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`

FTN)
isinstancer   
chat_boostremoved_chat_boostr   r   r   anyr   r   effective_chatidusernamebool)r   r#   chatr   r   s        r    check_updateChatBoostHandler.check_updatec   s     &&))!!V%>%>  DOO3F<M<M  D$;$;;FD]D]DNND$8$89:: '-&;&;;d;$''$)-4DNNB>>(AC 
t  Lm7K7K&KH
 	
r"   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   int__annotations__r   r   r   r   r	   r
   r   strr-   r   objectr/   __static_attributes____classcell__)r   s   @r    r   r      s    (TI  Jc
\%&c
&c!"NE#J"7 !+!%'+=)=!&#r/2= = #	=
  }= = =
6 
d 
 
r"   r   N)r5   typingr   r   telegramr   "telegram.ext._handlers.basehandlerr   #telegram.ext._utils._update_parsingr   r   telegram.ext._utils.typesr	   r
   r   r    r"   r    <module>rC      s5   & 7 "  : M > >e
{63?3 e
r"   