# Inline Telegram bot

The block turns on Telegram inline mode for the bot. A person types `@bot_name` and some text in any chat — and sees search results from your list right above the input field: products, addresses, services.

![Settings panel of the "Inline Telegram bot" block](https://support.watbot.org/_media/en/01-chatbots/03-blocks/06-developer/_images/inline-telegram.webp?v=1791781230)

No connections lead into this block from other blocks: it fires on a request from Telegram.

> [!IMPORTANT]
> Inline mode must be turned on for the bot itself: in [@BotFather](https://t.me/BotFather), send the `/setinline` command and choose the bot.

## Settings

- **"List"** — the list to search.
- **"Search field"** — the list field in which the bot looks for the text the person typed. If no field is chosen, the bot shows entries without searching.
- **"Tag"** — the category that starts this particular block. The person writes it after the bot's name with a hash sign: `@bot_name #tag text`. A tag may contain only Latin letters and digits. A request without a tag is handled by the block whose "Tag" field is empty.
- **"Additional filters"** — conditions that narrow the selection: a list field, a comparison sign and a value. Conditions are joined with "AND" or "OR". A row is added with the "Add Field" button.
- **"Sort"** — which field to sort entries by and in what order: "Asc" or "Desc". Without sorting, new entries come first.
- **"Search result fields"** — what the person sees in each result:
  - "Image" — a list field with an image;
  - "Title" — a text or number field. Entries with an empty title are left out of the results;
  - "Description" — the line under the title.
- **"Advanced"** → "Write the answer to the user variable" — the title of the chosen entry goes into the variable.

## How it works

1. The person types `@bot_name` and some text. The bot shows up to 50 entries and loads more on scrolling.
2. The person chooses an entry. A message with the block's command and the entry's title is sent to the chat on their behalf.
3. If it is a chat with your bot, the bot saves the title to the variable and follows the "Continue" connection.

If nothing is found, the person sees a single item — "The search has not given any results".

> [!TIP]
> To save the person from typing the bot's name by hand, add an item of the "Open inline bot Telegram" type to the menu of a block with buttons. In the "Search text" field you can set the beginning of the query right away, for example `#tag`.

## Outputs

- "Continue" — the person chose an entry from the results in the chat with the bot.

## Limits

- The block works only in Telegram.
- A filter value is up to 64 characters; up to 100 filters and up to 10 sort fields.
