Ë
    'PbjC  ã                   óh   — d Z ddlmZmZ  G d„ d«      Z G d„ d«      Z G d„ d«      Z G d	„ d
«      Zy)z+
File with all middleware classes, states.
é    )ÚStateÚStatesGroupc                   ó2   — e Zd ZU dZdZeed<   d„ Zd„ Zd„ Z	y)ÚBaseMiddlewareaÀ  
    Base class for middleware.
    Your middlewares should be inherited from this class.

    Set update_sensitive=True if you want to get different updates on
    different functions. For example, if you want to handle pre_process for
    message update, then you will have to create pre_process_message function, and
    so on. Same applies to post_process.

    .. code-block:: python
        :caption: Example of class-based middlewares

        class MyMiddleware(BaseMiddleware):
            def __init__(self):
                self.update_sensitive = True
                self.update_types = ['message', 'edited_message']
            
            async def pre_process_message(self, message, data):
                # only message update here
                pass

            async def post_process_message(self, message, data, exception):
                pass # only message update here for post_process

            async def pre_process_edited_message(self, message, data):
                # only edited_message update here
                pass

            async def post_process_edited_message(self, message, data, exception):
                pass # only edited_message update here for post_process
    FÚupdate_sensitivec                  ó   — y ©N© ©Úselfs    úS/var/www/html/venv/lib/python3.12/site-packages/telebot/asyncio_handler_backends.pyÚ__init__zBaseMiddleware.__init__*   ó   € Øó    c              ƒ   ó   K  — t         ‚­wr	   ©ÚNotImplementedError)r   ÚmessageÚdatas      r   Úpre_processzBaseMiddleware.pre_process-   ó   è ø€ Ü!Ð!ùó   ‚	c              ƒ   ó   K  — t         ‚­wr	   r   )r   r   r   Ú	exceptions       r   Úpost_processzBaseMiddleware.post_process0   r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚboolÚ__annotations__r   r   r   r
   r   r   r   r      s$   … ñð@ #Ð�dÓ"òò"ó"r   r   c                   ó   — e Zd ZdZdd„Zy)ÚSkipHandlerz½
    Class for skipping handlers.
    Just return instance of this class 
    in middleware to skip handler.
    Update will go to post_process,
    but will skip execution of handler.
    Nc                  ó   — y r	   r
   r   s    r   r   zSkipHandler.__init__=   r   r   ©ÚreturnN©r   r   r   r   r   r
   r   r   r#   r#   4   ó   „ ñôr   r#   c                   ó   — e Zd ZdZdd„Zy)ÚCancelUpdatez¿
    Class for canceling updates.
    Just return instance of this class 
    in middleware to skip update.
    Update will skip handler and execution
    of post_process in middlewares.
    Nc                  ó   — y r	   r
   r   s    r   r   zCancelUpdate.__init__J   r   r   r%   r'   r
   r   r   r*   r*   A   r(   r   r*   c                   ó   — e Zd ZdZdd„Zy)ÚContinueHandlinga7  
    Class for continue updates in handlers.
    Just return instance of this class 
    in handlers to continue process.
    
    .. code-block:: python3
        :caption: Example of using ContinueHandling

        @bot.message_handler(commands=['start'])
        async def start(message):
            await bot.send_message(message.chat.id, 'Hello World!')
            return ContinueHandling()
        
        @bot.message_handler(commands=['start'])
        async def start2(message):
            await bot.send_message(message.chat.id, 'Hello World2!')
   
    Nc                  ó   — y r	   r
   r   s    r   r   zContinueHandling.__init__a   r   r   r%   r'   r
   r   r   r-   r-   N   s   „ ñô$r   r-   N)r   Útelebot.statesr   r   r   r#   r*   r-   r
   r   r   ú<module>r0      s8   ðñ÷ .÷*"ñ *"÷Z
ñ 
÷
ñ 
÷ò r   