# Inline mode in Telegram

## What is inline mode in Telegram?

In addition to the fact that the bot can respond to any requests directly in a personal chat or group, using the online mode, you can globally access the bot in a chat, group or channel.

To contact a bot that has online mode enabled, just enter @\*bot name\* in the **Message** field.

The most striking and popular example of a bot working online is @gif, with which you can select and send gif images:

<div data-with-frame="true"><figure><img src="/files/3neEbevk9FPDE88PNVgk" alt="" width="563"><figcaption><p>The @gif bot will work in any chat.</p></figcaption></figure></div>

The @gif bot will work in any chat.

## How to enable inline mode?

In order for the bot to work in offline mode, you need to enable this option in the bot settings in [BotFather](https://t.me/BotFather).

Select the desired bot and go to the **Bot Settings**.

<div data-with-frame="true"><figure><img src="/files/wruf6vA5NlBsBCjnhHBV" alt="" width="315"><figcaption></figcaption></figure></div>

Then choose **Inline Mode**

<figure><img src="/files/Uiyd2QIWXGiaqqUqUhoF" alt="" width="375"><figcaption></figcaption></figure>

Here you need to enable the offline mode if it is not enabled.

<figure><img src="/files/rOPr4vX2FaX0VMI6eV0E" alt="" width="375"><figcaption></figcaption></figure>

## How to change placeholder?

If desired, you can change the placeholder that is displayed before entering the search query. By default, it is ***Search…***

<div data-with-frame="true"><figure><img src="/files/lBrLJyIbVR9TTBVfe3uM" alt="" width="563"><figcaption></figcaption></figure></div>

To change it, click the **Edit Inline Placeholder** button:

<div data-with-frame="true"><figure><img src="/files/Tr5goMUfA3sYx2gjp4Gw" alt="" width="563"><figcaption></figcaption></figure></div>

Define the exact placeholder content.

<div data-with-frame="true"><figure><img src="/files/R119Rk4nd3Ja8jjHMC4s" alt="" width="563"><figcaption></figcaption></figure></div>

## How to configure the output results

After clicking on an option from the list in inline mode, a message will be sent that is indicated in the header of the selected option, and you can adjust the reaction in the funnel to this value.

To specify the data to output in inline mode, you need to set the inline\_bot variable. In the inline mode, the search for values in the inline\_bot variable takes place almost in real time.

The data in the variable can be specified in three ways. Let's look from the simplest to the maximum settings.

### An array with text data

For example, the search will take place across an array of products.

<div data-with-frame="true"><figure><img src="/files/4rl6RhpbMNEPkpLzDQGL" alt="" width="563"><figcaption></figcaption></figure></div>

The inline\_bot variable is specified in the project settings. The search matches any array variant that contains the entered phrase.

<div data-with-frame="true"><figure><img src="/files/BlpYYRWCg6O02NczGf1p" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/fi1j7OoxDZbojblmNc2R" alt="" width="563"><figcaption></figcaption></figure></div>

When you enter the '@name\_\_of your\_\_bot' and the initial letters of the commands, a menu opens with the values that you specified in the project variable.

After clicking on the desired item, a message from the user will be sent to the bot, to which you can configure the reaction in the bot.

The block configuration looks like this:

<div data-with-frame="true"><figure><img src="/files/y5Dzy4zUXDBX7IjoDd6G" alt=""><figcaption></figcaption></figure></div>

Sample data:

\["Milk", "Bread", "Pasta", "Chocolate", "Eggs", "Butter", "Bun", "Tea", "Vegetables", "Fruit"]

### Output in the absence of filtering

You can set an empty key and assign it an array of lowercase values or an array of dictionaries. The bot will access the dictionary using an empty key and output buttons with values from the assigned array.

### An inline button with the specified search value

{% hint style="warning" %}
Please note!

Inline buttons in Telegram are not callbacks.

If you need to receive callbacks, then read about [callback buttons in Telegram.](/chatbot/messengers/telegram/buttons.md#callback-button)

The button only works in Telegram.
{% endhint %}

To set a search phrase, add the inline\_query parameter to the inline button with a value that is automatically inserted into the query.

It is recommended to use this option for the offline mode, as it will avoid mistakes and work faster.

For example, add three buttons that match the example from the previous chapter.

\[{"line":0,"index\_in\_line":0,"text":"Show the menu","type":"inline","inline\_query":"menu"},{"line":0,"index\_in\_line":1,"text":"Статьи","type":"inline","inline\_query":"posts"},{"line":2,"index\_in\_line":0,"text":"List of products","type":"inline","inline\_query":"products"}]

<div data-with-frame="true"><figure><img src="/files/ToqzFtgryQGLH5Gbkq0F" alt="" width="375"><figcaption></figcaption></figure></div>

When you click on a button, for example, an **Article,** the found list of buttons will be displayed (when adding, you specified "inline\_query":"posts" for this button):

<div data-with-frame="true"><figure><img src="/files/Dhy2jA7FLcwNXnocti96" alt="" width="375"><figcaption></figcaption></figure></div>

The options are taken from a given variable, as described above in the **"Dictionary with a list"** section:

<figure><img src="/files/GgmI9rcWOLHRel2H3bSJ" alt="" width="563"><figcaption></figcaption></figure>

### Notes

* The inline\_bot variable can be set not only in general variables, but also as a simple variable, but in this case its value must be enclosed in single quotes.

Example in the calculator field:

inline\_bot = '\["Milk", "Bread", "Pasta", "Chocolate", "Eggs", "Butter", "Puff Pastry", "Tea", "Vegetables", "Fruits", "#{aa}"]'

You can also pass any value as a variable for more flexible configuration.

For example, a simple option in an array:

<div data-with-frame="true"><figure><img src="/files/uShi7a0FWZMoxKNUkIY0" alt="" width="563"><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/chatbot/messengers/telegram/inline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
