Skip to main content
Telebot’s keyboard API is built around the ReplyMarkup struct. A single markup instance can carry either a reply keyboard (shown below the text input) or an inline keyboard (embedded inside a message).

ReplyMarkup

Create a new instance with b.NewMarkup() or directly with a struct literal:

Building reply keyboards

Reply keyboards appear as a persistent button panel below the input field. Use Btn constructors on the markup, then assemble rows and call .Reply().

Reply button types

.Text(text)

A plain-text button. Sends the label text as a message when tapped.

.Contact(text)

Requests the user’s phone number.

.Location(text)

Requests the user’s current location.

.Poll(text, pollType)

Lets the user create and send a poll. Pass tele.PollQuiz or tele.PollRegular.

Removing the keyboard

Send RemoveKeyboard: true to dismiss the reply keyboard for the user:
Or use the shortcut option flag:

Building inline keyboards

Inline keyboards are attached to individual messages. Use .Data(), .URL(), .Query(), .QueryChat(), or .Login() constructors, then call .Inline().

Inline button types

.Data(text, unique, data...)

Fires a callback. unique is the handler endpoint; optional data strings are joined by | and available as c.Args().

.URL(text, url)

Opens a URL in the browser when tapped.

.Query(text, query)

Switches to inline mode with a pre-filled query in any chat.

.QueryChat(text, query)

Switches to inline mode in the current chat.

.Login(text, login)

Opens Telegram Login Widget flow. Accepts a *tele.Login struct.

.WebApp(text, app)

Launches a Mini App. Accepts a *tele.WebApp.

The .Data() button and unique IDs

The unique parameter doubles as the callback endpoint registered with b.Handle():
Always c.Respond() in callback handlers — Telegram shows a loading spinner until a response is sent.

Splitting buttons into rows

Use menu.Row(btns...) for explicit row composition, or menu.Split(n, btns) to automatically chunk a slice into rows of n buttons:

Login buttons

The Login button opens the Telegram Login Widget flow and can forward the user back to your site:

Full inline keyboard example