Skip to main content
The callback payload store persists long reply / select values under a short reference so the exact value round-trips back to your handler when a user taps.

Quick Start

1

Zero-config on Telegram

TelegramBot already shares one store between its renderer and inbound registry — a long reply value round-trips back to your agent exactly.
2

Plug your own store

Implement CallbackPayloadStoreProtocol (put / get) with any backend and pass the same instance to both the registry and the renderer.

How It Works

The renderer stores overflowing values before send; the registry resolves the reference on click. Encoding only kicks in when the inline payload would overflow the channel cap.

Configuration

InMemoryCallbackPayloadStore is a bounded, zero-dependency, per-process store. It purges expired entries on every put and evicts oldest-inserted (FIFO) once full.

API surface


Failure modes


Best Practices

References only resolve when the same store instance backs both sides. A mismatch means put and get never meet, so taps silently drop.
The in-memory store is per-process and clears on restart. Back it with Redis or SQLite when references must survive restarts or span multiple workers.
The store is a safety net, not a substitute — short inline values skip the round-trip entirely and resolve faster.
Raise max_entries for very large menus so live references are not evicted before users tap; lower it to cap memory on constrained hosts.

Interactive Bot Actions

Wire button and select-menu clicks to your own handlers

Message Presentation

Build reply and select prompts agents send to chat

Bot Presentations

Adapt presentations to each channel’s limits

Telegram Durable Approval

Approvals that survive restarts on Telegram