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.

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.

Build a bot

Keep reading

Bots that use this

All twenty-five guides