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
b.NewMarkup() or directly with a struct literal:
Building reply keyboards
Reply keyboards appear as a persistent button panel below the input field. UseBtn 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
SendRemoveKeyboard: true to dismiss the reply keyboard for the user:
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
Theunique parameter doubles as the callback endpoint registered with b.Handle():
Splitting buttons into rows
Usemenu.Row(btns...) for explicit row composition, or menu.Split(n, btns) to automatically chunk a slice into rows of n buttons:
Login buttons
TheLogin button opens the Telegram Login Widget flow and can forward the user back to your site: