# Build Reply Keyboard

> Builds reply keyboards for messages using the telegram-bot DSL. Use when adding persistent or one-time keyboards, request contact/location buttons, or Web App buttons for user input.

- Skill: `tomevault-io/build-reply-keyboard` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/build-reply-keyboard`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/build-reply-keyboard/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/build-reply-keyboard

---


# Build Reply Keyboard

## Quick Start

Use `replyKeyboardMarkup { }` or `replyKeyboardMarkup(block)`. Attach via `markup()` or `replyKeyboardMarkup { }` on send actions.

```kotlin
message("Choose an option:")
    .replyKeyboardMarkup {
        +"Option A"
        +"Option B"
        newLine()
        "Share contact" requestContact true
        options { resizeKeyboard = true; oneTimeKeyboard = true }
    }
    .send(user, bot)
```

## Simple Buttons

Use unary plus to add plain text buttons:

```kotlin
+"Button 1"
+"Button 2"
newLine()
+"Next row"
```

## Special Buttons

| Type | Syntax | Availability |
|------|--------|--------------|
| Request contact | `"Share contact" requestContact true` | Private chats only |
| Request location | `"Share location" requestLocation true` | Private chats only |
| Request user | `"Select user" requestUser KeyboardButtonRequestUsers(...)` | Private chats only |
| Request chat | `"Select chat" requestChat KeyboardButtonRequestChat(...)` | Private chats only |
| Request poll | `"Create poll" requestPoll KeyboardButtonPollType(...)` | Private chats only |
| Web App | `"Open app" webApp "https://..."` | Private chats only |

## Options

Configure via `options { }`:

- `resizeKeyboard = true` — keyboard resizes to fit screen
- `oneTimeKeyboard = true` — keyboard hides after one use
- `inputFieldPlaceholder = "Type here..."` — placeholder in input field (1-64 chars)
- `selective = true` — show only to @mentioned users or reply target
- `isPersistent = true` — keyboard stays visible (for oneTimeKeyboard)

## Rows

Use `newLine()` or `br()` to start a new row, same as inline keyboards.

## Removing the Keyboard

When done, send a message with `replyKeyboardRemove()`:

```kotlin
message("Keyboard removed")
    .replyKeyboardRemove()
    .send(user, bot)
```

Or `replyKeyboardRemove(selective = true)` for selective removal.

## Reference

- [ReplyKeyboardMarkupBuilder.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/builders/ReplyKeyboardMarkupBuilder.kt)
- [ReplyKeyboardMarkupOptions.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/options/ReplyKeyboardMarkupOptions.kt)
- [MarkupFeature.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/features/MarkupFeature.kt)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/vendelieu) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

