§
    ­eîi–  ã                   ó€   — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZmZmZ  G d„ deeeef         ¦  «        Zd	S )
z0This module contains the ChatBoostHandler class.é    )ÚFinal)ÚUpdate)ÚBaseHandler)Úparse_chat_idÚparse_username)ÚCCTÚRTÚHandlerCallbackc                   óÎ   ‡ — e Zd ZU dZdZdZee         ed<   	 dZ	ee         ed<   	 dZ
ee         ed<   	 ed	d	d
fdddeeeef         deded	z  ded	z  defˆ fd„Zdedefd„Zˆ xZS )ÚChatBoostHandlera~  
    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                 ó¬   •— t          ¦   «                              ||¬¦  «         || _        t          |¦  «        | _        t          |¦  «        | _        d S )N)r   )ÚsuperÚ__init__r   r   r   r   r   )r   r   r   r   r   r   Ú	__class__s         €úk/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/ext/_handlers/chatboosthandler.pyr   zChatBoostHandler.__init__V   sO   ø€ õ 	‰Œ×Ò˜¨ÐÑ/Ô/Ð/Ø%5ˆÔÝ& wÑ/Ô/ˆŒÝ-¨mÑ<Ô<ˆÔÐÐó    ÚupdateÚreturnc                 óœ  — t          |t          ¦  «        sdS |j        s	|j        sdS | j        | j        k    r	|j        sdS | j        | j        k    r	|j        sdS t          | j        | j	        f¦  «        sdS |j
        x}r|j        nd}|r|j        nd}t          | j        o|| j        v ¦  «        pt          | j	        o|| j	        v ¦  «        S )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:`bool`

        FTN)Ú
isinstancer   Ú
chat_boostÚremoved_chat_boostr   r   r   Úanyr   r   Úeffective_chatÚidÚusernameÚbool)r   r    Úchatr   r   s        r   Úcheck_updatezChatBoostHandler.check_updatec   sý   € õ ˜&¥&Ñ)Ô)ð 	Ø�5àÔ!ð 	 VÔ%>ð 	Ø�5àÔ  D¤OÒ3Ð3¸FÔ<MÐ3Ø�5àÔ  DÔ$;Ò;Ð;ÀFÔD]Ð;Ø�5å�D”N DÔ$8Ð9Ñ:Ô:ð 	Ø�4ð '-Ô&;Ð;˜dÐF�$”'�'À$ˆØ)-Ð7˜œ˜°4ˆå�D”NÐB¨°4´>Ð(AÑCÔCð 
ÅtØÔ ÐL m°tÔ7KÐ&KñH
ô H
ð 	
r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   ÚintÚ__annotations__r   r   r
   r   r   r	   Ústrr*   r   Úobjectr,   Ú__classcell__)r   s   @r   r   r      s  ø€ € € € € € ð(ð (ðT€Ið  €J��c”
ÐÐÑØ\Ø%&Ð˜˜cœ
Ð&Ð&Ñ&ØcØ!"€N�E˜#”JÐ"Ð"Ñ"ð7ð !+Ø"Ø$(Øð=ð =Ø)ð=à! &¨#¨r /Ô2ð=ð ð=ð �t‘ð	=ð
 ˜T‘zð=ð ð=ð =ð =ð =ð =ð =ð
 6ð 
¨dð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r   N)r0   Útypingr   Útelegramr   Ú"telegram.ext._handlers.basehandlerr   Ú#telegram.ext._utils._update_parsingr   r   Útelegram.ext._utils.typesr   r	   r
   r   © r   r   ú<module>r=      sÂ   ðð& 7Ð 6à Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø :Ð :Ð :Ð :Ð :Ð :Ø MÐ MÐ MÐ MÐ MÐ MÐ MÐ MØ >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >ðe
ð e
ð e
ð e
ð e
�{ 6¨3° ?Ô3ñ e
ô e
ð e
ð e
ð e
r   