U
    h	                     @   sL   d dl Z ddlmZ ddlmZmZmZ e jr:ddlm	Z	 G dd dZ
dS )	    N   )hints)types	functionscustom   )TelegramClientc                	   @   s2   e Zd ZddddddededejdddZdS )	
BotMethodsN)entityoffset	geo_pointr   zhints.EntityLikeztypes.GeoPoint)selfbotqueryr
   r   r   returnc                   sj   |  |I dH }|r&|  |I dH }nt }| tjj||||pBd|dI dH }tj| ||rb|nddS )a  
        Makes an inline query to the specified bot (``@vote New Poll``).

        Arguments
            bot (`entity`):
                The bot entity to which the inline query should be made.

            query (`str`):
                The query that should be made to the bot.

            entity (`entity`, optional):
                The entity where the inline query is being made from. Certain
                bots use this to display different results depending on where
                it's used, such as private chats, groups or channels.

                If specified, it will also be the default entity where the
                message will be sent after clicked. Otherwise, the "empty
                peer" will be used, which some bots may not handle correctly.

            offset (`str`, optional):
                The string offset to use for the bot.

            geo_point (:tl:`GeoPoint`, optional)
                The geo point location information to send to the bot
                for localised results. Available under some bots.

        Returns
            A list of `custom.InlineResult
            <telethon.tl.custom.inlineresult.InlineResult>`.

        Example
            .. code-block:: python

                # Make an inline query to @like
                results = await client.inline_query('like', 'Do you like Telethon?')

                # Send the first result to some chat
                message = await results[0].click('TelethonOffTopic')
        N )r   peerr   r   r   )r
   )Zget_input_entityr   ZInputPeerEmptyr   messagesZGetInlineBotResultsRequestr   InlineResults)r   r   r   r
   r   r   r   result r   8/tmp/pip-unpacked-wheel-c81u5j2r/telethon/client/bots.pyinline_query   s    /zBotMethods.inline_query)__name__
__module____qualname__strr   r   r   r   r   r   r   r	   
   s    r	   )typingr   r   tlr   r   r   TYPE_CHECKINGZtelegramclientr   r	   r   r   r   r   <module>   s
   