U
    hs                     @   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                   sr   t  j|d |sd | _nTt|sDt|ts<td||| _n*t	dd |D sdt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   7/tmp/pip-unpacked-wheel-c81u5j2r/telethon/events/raw.py	<genexpr>$   s     zRaw.__init__.<locals>.<genexpr>zInvalid input types given: {})super__init__typesr   Zis_list_liker	   r
   	TypeErrorformatalltuple)selfr   r   	__class__r   r   r      s    

zRaw.__init__c                    s
   d| _ d S )NT)Zresolved)r   clientr   r   r   resolve)   s    zRaw.resolvec                 C   s   |S r   r   )clsupdateZ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.filter)N)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   