Inline query ID
Results of the query
Optional
params: { Additional parameters
Optional
cacheMaximum number of time in seconds that the results of the query may be cached on the server for.
Optional
gallery?: booleanWhether the results should be displayed as a gallery instead of a vertical list. Only applicable to some media types.
In some cases changing this may lead to the results not being displayed by the client.
Default is derived automatically based on result types
Optional
nextNext pagination offset (up to 64 bytes).
When user has reached the end of the current results,
the client will re-send the inline query with the same text, but
with offset
set to this value.
If omitted or empty string is provided, it is assumed that there are no more results.
Optional
private?: booleanWhether the results should only be cached on the server for the user who sent the query.
Optional
switchIf passed, clients will display a button before any other results,
that when clicked switches the user to a private chat with the bot
and sends the bot /start ${parameter}
.
An example from the Bot API docs:
An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a "Connect your YouTube account" button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities
Parameter for /start
command
Text of the button
Optional
switchIf passed, clients will display a button on top of the remaining inline result list with the specified text, that switches the user to the specified bot web app.
Text of the button
URL to open
Answer an inline query.