# Vendelieu Telegram Bot Build Inline Keyboard

> Build Inline Keyboard

- Skill: `tomevault-io/vendelieu-telegram-bot-build-inline-keyboard` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/vendelieu-telegram-bot-build-inline-keyboard`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/vendelieu-telegram-bot-build-inline-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/vendelieu-telegram-bot-build-inline-keyboard

---


# Build Inline Keyboard

## Quick Start

Use `inlineKeyboardMarkup { }` or `inlineKeyboardMarkup(block)` to create inline keyboards. Attach via `markup()` or `inlineKeyboardMarkup { }` on send actions.

```kotlin
message("Choose an option:")
    .inlineKeyboardMarkup {
        "Option A" callback "opt_a"
        "Option B" callback "opt_b"
        newLine()
        "Open link" url "https://example.com"
    }
    .send(user, bot)
```

## Button Types

| Type | Syntax | Use case |
|------|--------|----------|
| Callback | `"Label" callback "data"` or `callbackData("Label") { "data" }` | Button press sends callback to bot (1-64 bytes) |
| URL | `"Label" url "https://..."` | Opens URL when pressed |
| Web App | `"Label" webAppInfo "https://..."` | Opens Web App |
| Switch inline | `"Label" switchInlineQuery "query"` | Opens inline mode in another chat |
| Switch inline (current) | `"Label" switchInlineQueryCurrentChat "query"` | Inserts bot + query in current chat |
| Pay | `"Pay" pay()` | Payment button |
| Copy text | `"Label" copyText "text"` | Copies text to clipboard |

## Rows

- Each `url()`, `callbackData()`, etc. adds a button to the current row
- Use `newLine()` or `br()` to start a new row

```kotlin
inlineKeyboardMarkup {
    "Yes" callback "yes"
    "No" callback "no"
    newLine()
    "Cancel" callback "cancel"
}
```

## Attaching to Messages

Actions with `MarkupFeature` (e.g. `message`, `sendPhoto`, `editMessageText`) support:

- `inlineKeyboardMarkup { ... }` — builder block
- `markup(inlineKeyboardMarkup { ... })` — explicit markup

## Callback Data Limits

- 1-64 bytes for `callbackData`
- Use prefixes for routing: `"action:id"`, `"vote:123"`

## Reference

- [InlineKeyboardMarkupBuilder.kt](telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/builders/InlineKeyboardMarkupBuilder.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 -->

