Building
Telegram inline keyboards vs reply keyboards: which to use
By the Botable team
Inline keyboards attach buttons to a specific message and send a silent callback when tapped. Reply keyboards replace the user's typing keyboard and send the button's label as a normal message. Inline is right for almost everything.
Watch it
Inline keyboards attach to a message and edit in place; reply keyboards replace the user's keyboard and stay. Picking the wrong one is the most common design mistake in bots.
Read the transcript
Everything said in the video, in order.
Telegram gives you two button systems. They look alike in a screenshot and behave nothing alike in a chat.
Picking the wrong one is the most common mistake in bot design. Here is how each behaves, and when.
An inline keyboard belongs to one message. The Flow view draws each screen the way Telegram will, so the buttons sit right under the text they arrived with.
Tapping one sends a silent callback rather than a message. Nothing lands in the chat, and the bot can rewrite that same message in place instead of sending another.
A reply keyboard is the other kind. It replaces the person's typing keyboard, so a tap arrives as an ordinary text message — and nothing on this map uses one.
It also outlives the message it came with, staying until the bot removes it. That fits a fixed main menu, like the one this card drops you back on, and little else.
In a group that becomes noise. Everyone there sees the keyboard unless you mark it selective, and every tap posts a visible message into the conversation.
Every button on this map is inline, and the dot under one is where its thread leaves. Use inline unless you want the choice to appear as a message the user sent.
Two button systems, one right answer nearly every time. Start free at botable dot I O.
The short version
Telegram has two button systems that look similar and behave nothing alike. An inline keyboard attaches to one message; tapping a button fires a callback the bot handles silently, without adding anything to the chat, and the bot can then edit that same message in place. That makes it the correct choice for menus, confirmations, pagination and anything stateful, because the conversation does not fill up with the mechanics of using it. A reply keyboard replaces the user's on-screen keyboard with a grid of suggestions, and tapping one sends its label as an ordinary text message, visible to everyone, indistinguishable from typing, and cluttering in a group. Reply keyboards suit a persistent main menu in a private chat and little else. The practical rule: use inline unless you specifically want the choice to appear as a message the user sent.
Step by step
When should you use an inline keyboard?
Almost always. Menus, confirmations, pagination, settings toggles, quiz answers, anything with more than one step. The bot can edit the message the buttons are attached to, so a multi-step flow happens inside one message rather than as a growing stack of them.
When is a reply keyboard the right tool?
A persistent main menu in a private chat, where the same three or four options are wanted on every turn and having them appear as sent messages is acceptable. Also for Telegram's built-in request buttons, such as asking for a contact or a location, which only exist on reply keyboards.
Why do inline buttons sometimes appear stuck?
Because the callback was not answered. Every callback query should be acknowledged, even with nothing to say, or the client shows a loading state on the button for several seconds. It is one call and it is the most common polish bug in bot interfaces.
How many buttons should a row hold?
Two or three, depending on label length. Long labels wrap and become mis-tappable on a phone. Prefer more rows over wider ones, and keep the whole keyboard within a screen, a keyboard that needs scrolling has stopped being a menu.
What catches people out
- Unanswered callback queries leave the button spinning, which reads as a broken bot
- Reply keyboard taps post the label as a visible message, in a group that is noise
- Callback data has a small size limit; store state in your database and put a key in the button
Questions
Can buttons open a link or another chat?
Yes. Inline buttons support URL buttons, buttons that switch to inline mode in another chat, and buttons that open a Mini App. Those are different button types on the same keyboard, so one row can mix them.
Can I remove a keyboard after it is used?
Yes, edit the message to drop the inline keyboard once a choice is made, which prevents someone tapping a stale option ten messages later. Reply keyboards are removed with an explicit remove instruction.
Want a bot that does this?
Describe it in plain language and Botable writes the code, gives the bot its own database, deploys it and keeps it running. Everything on this page is handled for you, the token, the webhook, the storage, the hosting.
Keep reading
- Command menustelegram bot commands menu
- Photos and filestelegram bot send photo
- Telegram Mini Appstelegram mini apps