peyk.platforms.telegram.types.inline_query

Classes

InlineQuery(id[, from_, query, offset, ...])

This object represents an incoming inline query.

class peyk.platforms.telegram.types.inline_query.InlineQuery(id: str, from_: User | None = None, query: str = '', offset: str = '', chat_type: str | None = None, location: Location | None = None, bot: 'Bot[object]' | None = None)[source]

Bases: object

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

Variables:
  • id (str) – Unique identifier for this query

  • from – Sender

  • query (str) – Text of the query (up to 256 characters)

  • offset (str) – Offset of the results to be returned, can be controlled by the bot

  • chat_type (Optional[str]) – Type of the chat from which the inline query was sent. Can be either ‘sender’ for a private chat with the inline query sender, ‘private’, ‘group’, ‘supergroup’, or ‘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.

  • location (Optional[Location]) – Sender location, only for bots that request user location

id: str
from_: User | None = None
query: str = ''
offset: str = ''
chat_type: str | None = None
location: Location | None = None
bot: 'Bot[object]' | None = None
async answer(results: Sequence[InlineQueryResultArticle | InlineQueryResultPhoto | InlineQueryResultGif | InlineQueryResultMpeg4Gif | InlineQueryResultVideo | InlineQueryResultAudio | InlineQueryResultVoice | InlineQueryResultDocument | InlineQueryResultLocation | InlineQueryResultVenue | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultCachedPhoto | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedSticker | InlineQueryResultCachedDocument | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultCachedAudio | Mapping[str, object]], *, cache_time: int | None = None, is_personal: bool | None = None, next_offset: str | None = None, button: object | None = None) bool[source]

Answer this inline query through the bot injected by the dispatcher.

classmethod from_dict(data: dict | None) InlineQuery | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.