How inline bots work, and when to use one

Most bots work inside their own chat. Inline bots also work everywhere else: in any private chat, group or channel, you type the bot's username and a few words, and it offers results you can send right there. The bot doesn't need to be a member of that chat. Here's how inline mode works, how to turn it on, and when it's worth using.

Friendsbot
@whisper_bot see you at 6, bring the cake @lina_k
🔒 A secret whisper to @lina_k. Only they can see it.
Show the whisper
Inline mode: the bot is used from inside a normal group chat.

What inline mode is

Inline mode is a way to use a bot without opening it. You stay in the chat you're in, type @botusername followed by a query in the message field, and the bot shows a list of results above the keyboard. Tap one, and it's sent into the chat as your message, with a small "via @botusername" label so everyone knows where it came from.

The results can be text, photos, GIFs, voice clips, videos or files, and they can carry buttons. The query is whatever you type after the username: a search word, a sentence to translate, a message to hide.

The key difference from a normal bot is where it works. A normal bot answers in its own chat, or in groups it was added to. An inline bot works in any chat its user is in, including a private chat with a friend who has never heard of the bot.

How to use an inline bot

  1. Open any chat: a friend, a group or a channel you can post in.
  2. In the message field, type the bot's username with @, then a space. For example, @soundbox_bot .
  3. Type your query after it, like applause. Results appear above the message field as you type.
  4. Tap the result you want. It's sent into the chat.

Some inline bots show results before you type anything, such as popular or recent items. Many also show a short hint in the message field, like "Search clips...", to tell you what to type.

You don't have to add the bot to the group, and the other people in the chat don't need to use the bot. They just see the message you sent. If they tap a button on it, the bot can respond to that.

Telegram's own @gif works the same way, so if you've ever searched for a GIF from the message field, you've already used inline mode.

How to turn on inline mode for your bot

Inline mode is off for every new bot. You turn it on in @BotFather:

  1. Open @BotFather and send /setinline.
  2. Pick your bot.
  3. Send the placeholder: the grey hint text people see in the message field after typing your bot's username, for example Type a word to search clips...

Write the placeholder as an instruction. "Search..." is vague. "Type text to translate" or "Message, then @username" tells people exactly what to do, which matters because inline mode has no welcome screen.

Turning on inline mode only tells Telegram to send queries to your bot. The bot's code still has to answer them. If the code doesn't support inline mode, people will see an empty list or a spinner. The reverse is also true: if your bot's code supports inline mode but you never ran /setinline, Telegram shows nothing when people type its username.

If you launch a template that uses inline mode, check this setting first. It takes a minute and it's the most common reason an inline bot "doesn't work".

Real examples of inline bots

Inline mode suits small, quick actions that make sense inside a conversation. Several Echo Maker templates are built around it:

  • Secret messages. In the Whisper template, you type the bot's username, a message and a friend's @username. The group sees a locked message with a Show the whisper button, and only the person named can open it. Everyone else sees that it isn't for them.
  • Translation on the spot. The Translator template lets users type the bot's username and some text in any chat to translate it without leaving the conversation.
  • Games with friends. In Tic-Tac-Toe, one person posts a board through inline mode, a friend taps Start playing, and they take turns on a 3×3 grid of buttons. In Rock Paper Scissors, you post a challenge with your move hidden until a friend picks theirs.
  • A soundboard. With Voice Notes, people type the bot's username and a word like "applause", pick a clip from the results, and it's sent as a voice message into the chat.
  • Sharing saved posts. The Professional Posts template lets you share a saved post with buttons into any chat through inline mode.

Notice the pattern. Each one does a single thing that's useful in the middle of a conversation, and the result is meant for other people to see.

Limits and trade-offs

Inline mode is clever, but it's not the answer to everything.

  • People have to know the username. Nothing in Telegram suggests your inline bot to someone who hasn't used it. Short, easy-to-spell usernames help a lot here, and they can't be changed later.
  • It's one query at a time. There's no back-and-forth in the chat. If a task needs several steps, like choosing options and confirming, it belongs in the bot's own chat. The bot can offer a button that switches the user there.
  • The bot doesn't see the chat. It receives what the user typed after its username and who typed it, but not the other messages in that chat. That's good for privacy, but it means an inline bot can't react to the conversation around it.
  • Results must come back fast. People expect results to appear as they type. A slow bot feels broken, so inline mode suits fast lookups better than heavy jobs like converting a large file.
  • Text queries only. Users type text after the username. They can't attach a photo or file to an inline query, so tasks like "translate this photo" still happen in the bot's chat.
  • Anyone can see what was sent. The message lands in the chat for everyone. That's the point for games and clips, but it's worth remembering. Even a whisper is a visible message: only its content is locked.

When inline mode is the right choice

Inline mode is a good fit when:

  • The result is something to share with others: a clip, a sticker-like image, a game board, a translated line, a formatted post.
  • The task fits in one line of text, like a search word or a short sentence.
  • People will use it in the middle of conversations, often in groups where adding a bot isn't an option.

It's a poor fit when the task is private (a support request, an order), when it needs files, or when it takes several steps. Those belong in the bot's own chat, driven by buttons and commands. For richer screens, a Mini App may be better.

Many good bots use both. The main chat holds settings, history and anything personal, and inline mode is the shortcut for sharing results everywhere else.

Inline mode also helps a bot spread. Every inline message shows "via @yourbot", and anyone in the chat can tap that label to start using the bot themselves. For a fun bot, that can be its main source of new users. More on this in how to promote a Telegram bot.

If you'd rather not write the code yourself, the templates above run on Echo Maker without any. For more starting points, see Telegram bot ideas.

Common questions

Does an inline bot need to be added to the group?

No. Inline mode works in any chat you can write in. The bot never becomes a member of that chat.

Can an inline bot read my group's messages?

No. It only receives the text you type after its username, and taps on buttons on its own messages. It doesn't see the rest of the chat.

Why does nothing happen when I type a bot's username?

Inline mode is probably off for that bot. Its owner has to turn it on with /setinline in @BotFather, and the bot's code has to support it.

How do I change the hint text for my inline bot?

Send /setinline to @BotFather again, pick the bot and send the new placeholder text.