
    ;Si
                     .    d dl Z ddlmZ  G d de      Zy)    N   )InlineResultc                   @     e Zd ZdZdd fd
Zd Zd Zd Zd Z xZ	S )	InlineResultsaj  
    Custom class that encapsulates :tl:`BotResults` providing
    an abstraction to easily access some commonly needed features
    (such as clicking one of the results to select it)

    Note that this is a list of `InlineResult
    <telethon.tl.custom.inlineresult.InlineResult>`
    so you can iterate over it or use indices to
    access its elements. In addition, it has some
    attributes.

    Attributes:
        result (:tl:`BotResults`):
            The original :tl:`BotResults` object.

        query_id (`int`):
            The random ID that identifies this query.

        cache_time (`int`):
            For how long the results should be considered
            valid. You can call `results_valid` at any
            moment to determine if the results are still
            valid or not.

        users (:tl:`User`):
            The users present in this inline query.

        gallery (`bool`):
            Whether these results should be presented
            in a grid (as a gallery of images) or not.

        next_offset (`str`, optional):
            The string to be used as an offset to get
            the next chunk of results, if any.

        switch_pm (:tl:`InlineBotSwitchPM`, optional):
            If presents, the results should show a button to
            switch to a private conversation with the bot using
            the text in this object.
    Nentityc                   t         |   fdj                  D               | _        j                  | _        j
                  | _        t        j                         | j
                  z   | _        j                  | _        t        j                        | _
        j                  | _        j                  | _        y )Nc              3   P   K   | ]  }t        |j                           yw)r   N)r   query_id).0xclientr   originals     e/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/tl/custom/inlineresults.py	<genexpr>z)InlineResults.__init__.<locals>.<genexpr>0   s-      4 &fa1B1B6RR 4s   #&)super__init__resultsresultr   
cache_timetime_valid_untilusersboolgallerynext_offset	switch_pm)selfr   r   r   	__class__s    ```r   r   zInlineResults.__init__/   s     4"*"2"24 	4  ))"-- IIK$//9^^
H,,-#//!++    c                 D    t        j                          | j                  k  S )z}
        Returns `True` if the cache time has not expired
        yet and the results can still be considered valid.
        )r   r   r   s    r   results_validzInlineResults.results_valid<   s    
 yy{T....r    c           	          dj                  dj                  fd| D              | j                  | j                  | j                  | j
                  | j                  | j                        S )NzT[{}, query_id={}, cache_time={}, users={}, gallery={}, next_offset={}, switch_pm={}]z, c              3   .   K   | ]  } |        y wN )r   r   item_functions     r   r   z(InlineResults._to_str.<locals>.<genexpr>F   s     51mA&5s   )formatjoinr   r   r   r   r   r   )r   r(   s    `r   _to_strzInlineResults._to_strC   sU    006II555MMOOJJLLNN1
		r    c                 ,    | j                  t              S r&   )r+   strr"   s    r   __str__zInlineResults.__str__O   s    ||C  r    c                 ,    | j                  t              S r&   )r+   reprr"   s    r   __repr__zInlineResults.__repr__R   s    ||D!!r    )
__name__
__module____qualname____doc__r   r#   r+   r.   r1   __classcell__)r   s   @r   r   r      s'    'P 48 ,/
!"r    r   )r   inlineresultr   listr   r'   r    r   <module>r9      s     &M"D M"r    