• Answer an inline query.

    Parameters

    • client: ITelegramClient
    • queryId: Long | InlineQuery

      Inline query ID

    • results: InputInlineResult[]

      Results of the query

    • Optionalparams: {
          cacheTime?: number;
          gallery?: boolean;
          nextOffset?: string;
          private?: boolean;
          switchPm?: {
              parameter: string;
              text: string;
          };
          switchWebview?: {
              text: string;
              url: string;
          };
      }

      Additional parameters

      • OptionalcacheTime?: number

        Maximum number of time in seconds that the results of the query may be cached on the server for.

        300
        
      • Optionalgallery?: boolean

        Whether 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

      • OptionalnextOffset?: string

        Next 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.

      • Optionalprivate?: boolean

        Whether the results should only be cached on the server for the user who sent the query.

        false
        
      • OptionalswitchPm?: {
            parameter: string;
            text: string;
        }

        If 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: string

          Parameter for /start command

        • text: string

          Text of the button

      • OptionalswitchWebview?: {
            text: string;
            url: string;
        }

        If 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: string

          Text of the button

        • url: string

          URL to open

    Returns Promise<void>