o
    Xzjs  ã                   @   s,   d dl mZ ddlmZ G dd„ deƒZdS )é   )ÚEventBuilderé   )Úutilsc                       sF   e Zd ZdZdddœ‡ fdd„Zdd„ Zeddd	„ƒZd
d„ Z‡  Z	S )ÚRawa^  
    Raw events are not actual events. Instead, they are the raw
    :tl:`Update` object that Telegram sends. You normally shouldn't
    need these.

    Args:
        types (`list` | `tuple` | `type`, optional):
            The type or types that the :tl:`Update` instance must be.
            Equivalent to ``if not isinstance(update, types): return``.

    Example
        .. code-block:: python

            from telethon import events

            @client.on(events.Raw)
            async def handler(update):
                # Print all incoming updates
                print(update.stringify())
    N©Úfuncc                   sv   t ƒ j|d� |sd | _d S t |¡s$t|tƒstd |¡ƒ‚|| _d S t	dd„ |D ƒƒs4td |¡ƒ‚t
|ƒ| _d S )Nr   zInvalid input type given: {}c                 s   s   � | ]}t |tƒV  qd S ©N)Ú
isinstanceÚtype)Ú.0Úx© r   úN/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telethon/events/raw.pyÚ	<genexpr>$   s   € zRaw.__init__.<locals>.<genexpr>zInvalid input types given: {})ÚsuperÚ__init__Útypesr   Úis_list_liker	   r
   Ú	TypeErrorÚformatÚallÚtuple)Úselfr   r   ©Ú	__class__r   r   r      s   



zRaw.__init__c                 Ã   s   �d| _ d S )NT)Úresolved)r   Úclientr   r   r   Úresolve)   s   €
zRaw.resolvec                 C   s   |S r   r   )ÚclsÚupdateÚothersÚself_idr   r   r   Úbuild,   s   z	Raw.buildc                 C   s*   | j r	t|| j ƒr| jr|  |¡S |S d S r   )r   r	   r   )r   Úeventr   r   r   Úfilter0   s
   
üz
Raw.filterr   )NN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úclassmethodr"   r$   Ú__classcell__r   r   r   r   r      s    r   N)Úcommonr   Ú r   r   r   r   r   r   Ú<module>   s    