L i#dZddlmZddlmZmZmZmZmZddl m Z ddl m Z ddl mZddlmZddlmZdd lmZdd lmZdd lmZmZmZerdd l mZmZGd deZy)zFThis module contains an object that represents a Telegram InlineQuery.)Sequence) TYPE_CHECKINGCallableFinalOptionalUnion) constants)Location)InlineQueryResultsButton)TelegramObject)User)de_json_optional) DEFAULT_NONE)JSONDictODVInput TimePeriod)BotInlineQueryResultceZdZUdZdZ d$dddedededed eed eed ee ffd Z e d%d e dedddffd Z d&dde e e e dddeedeegeedffdeedeedeedeedeededeedeedeedeed ee defd Zej2j4Zeeed!< ej2j<Zeeed"< ej2j>Zeeed#<xZ S)' InlineQuerya This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`id` is equal. .. figure:: https://core.telegram.org/file/464001466/10e4a/r4FKyQ7gw5g.134366/f2 606a53d683374703 :align: center Inline queries on Telegram .. seealso:: The :class:`telegram.InlineQueryResult` classes represent the media the user can choose from (see above figure). Note: In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead. .. versionchanged:: 20.0 The following are now keyword-only arguments in Bot methods: ``{read, write, connect, pool}_timeout``, :paramref:`answer.api_kwargs`, ``auto_pagination``. Use a named argument for those, and notice that some positional arguments changed position as a result. .. versionchanged:: 22.0 Removed constants ``MIN_START_PARAMETER_LENGTH`` and ``MAX_START_PARAMETER_LENGTH``. Use :attr:`telegram.constants.InlineQueryResultsButtonLimit.MIN_START_PARAMETER_LENGTH` and :attr:`telegram.constants.InlineQueryResultsButtonLimit.MAX_START_PARAMETER_LENGTH` instead. Args: id (:obj:`str`): Unique identifier for this query. from_user (:class:`telegram.User`): Sender. query (:obj:`str`): Text of the query (up to :tg-const:`telegram.InlineQuery.MAX_QUERY_LENGTH` characters). offset (:obj:`str`): Offset of the results to be returned, can be controlled by the bot. chat_type (:obj:`str`, optional): Type of the chat, from which the inline query was sent. Can be either :tg-const:`telegram.Chat.SENDER` for a private chat with the inline query sender, :tg-const:`telegram.Chat.PRIVATE`, :tg-const:`telegram.Chat.GROUP`, :tg-const:`telegram.Chat.SUPERGROUP` or :tg-const:`telegram.Chat.CHANNEL`. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. .. versionadded:: 13.5 location (:class:`telegram.Location`, optional): Sender location, only for bots that request user location. Attributes: id (:obj:`str`): Unique identifier for this query. from_user (:class:`telegram.User`): Sender. query (:obj:`str`): Text of the query (up to :tg-const:`telegram.InlineQuery.MAX_QUERY_LENGTH` characters). offset (:obj:`str`): Offset of the results to be returned, can be controlled by the bot. chat_type (:obj:`str`): Optional. Type of the chat, from which the inline query was sent. Can be either :tg-const:`telegram.Chat.SENDER` for a private chat with the inline query sender, :tg-const:`telegram.Chat.PRIVATE`, :tg-const:`telegram.Chat.GROUP`, :tg-const:`telegram.Chat.SUPERGROUP` or :tg-const:`telegram.Chat.CHANNEL`. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat. .. versionadded:: 13.5 location (:class:`telegram.Location`): Optional. Sender location, only for bots that request user location. ) chat_type from_useridlocationoffsetqueryN api_kwargsrrrrrrrct||||_||_||_||_||_||_|jf|_|jy)Nr) super__init__rrrrrr _id_attrs_freeze) selfrrrrrrr __class__s b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_inline/inlinequery.pyr!zInlineQuery.__init__msW J/( ! -5 (1'' databotrreturnc|j|}t|jddt||d<t|j dt ||d<t |||S)z,See :meth:`telegram.TelegramObject.de_json`.fromNrr)r(r)) _parse_datarpopr getr r de_json)clsr(r)r%s r&r0zInlineQuery.de_jsons`t$,TXXfd-CT3O[+DHHZ,@(CPZwDc22r'F)current_offsetauto_pagination read_timeout write_timeoutconnect_timeout pool_timeoutrresultsr cache_time is_personal next_offsetbuttonr2r3r4r5r6r7cK|r |r td|jj|j|r |jn|||||||| | | |  d{S7w)aShortcut for:: await bot.answer_inline_query( update.inline_query.id, *args, current_offset=self.offset if auto_pagination else None, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.answer_inline_query`. .. versionchanged:: 20.0 Raises :class:`ValueError` instead of :class:`TypeError`. Keyword Args: auto_pagination (:obj:`bool`, optional): If set to :obj:`True`, :attr:`offset` will be passed as :paramref:`current_offset ` to :meth:`telegram.Bot.answer_inline_query`. Defaults to :obj:`False`. Raises: ValueError: If both :paramref:`~telegram.Bot.answer_inline_query.current_offset` and :paramref:`auto_pagination` are supplied. z:current_offset and auto_pagination are mutually exclusive!) inline_query_idr2r8r9r:r;r<r4r5r6r7rN) ValueErrorget_botanswer_inline_queryrr) r$r8r9r:r;r<r2r3r4r5r6r7rs r&answerzInlineQuery.answersrX oYZ Z\\^77 GG*94;;~!##%'+%!8    sAAAA MAX_RESULTSMAX_OFFSET_LENGTHMAX_QUERY_LENGTH)NN)N)NNNN)!__name__ __module__ __qualname____doc__ __slots__strr rr rr! classmethodr0rrrrintrboolr rfloatrBr InlineQueryLimitRESULTSrCr__annotations__rDrE __classcell__)r%s@r&rr&sBHPI(,#'*.     8$ C=X&4383(5/3]33,0&*%)59; )- %(4)5+7(4)-!;  ( )8SE8HM`Da;b4b+c c ; Z( ; d^ ; c]; 12; ! ; ; uo;  ; "%; uo; X&!; " #; z(88@@Ks@%.$>$>$P$PuSzP$-#=#=#N#NeCjNr'rN)rIcollections.abcrtypingrrrrrtelegramr telegram._files.locationr )telegram._inline.inlinequeryresultsbuttonr telegram._telegramobjectr telegram._userr telegram._utils.argumentparsingrtelegram._utils.defaultvaluertelegram._utils.typesrrrrrrr'r&r_sC(M$BB-N3<5@@/v.vr'