Telegram Inline Buttons
Default rule
When sending a proactive message or asking Rahul to choose/confirm something on
Telegram, prefer
inline buttons over free-text prompts.
Use buttons for:
- - Y/N confirmations
- A/B (or A/B/C) choices
- “Do it now vs later”
- Selecting one of a few next actions
Do not use buttons when:
- - The message is purely informational (no action required)
- The user needs to paste/enter a value (then ask for text input)
- There are >5 options (summarize + offer “Show more”)
Button design
- - Keep button labels short (1–4 words)
- 2–4 buttons is ideal
- Always include a safe escape hatch when appropriate:
- “Not now” / “Later” / “Skip”
- - Map button presses to clear next actions in follow-up turns
After a button selection (automatic)
Telegram doesn’t support arbitrary text color in normal bot messages. To make the selection
visually pop, do this automatically after a click:
1)
Edit the original message to remove the inline keyboard
2) Append a standout selection line using emoji / symbols (chosen based on meaning)
Emoji mapping (standard)
- - ✅ / 🟩 = approve / yes / proceed / confirm
- 🟥 = no / cancel / stop
- ⬛ = later / skip / defer
Do not send an extra follow-up message that repeats the selection—editing is sufficient unless there’s additional context/results to report.
Tooling rule: if you used functions.message (send/edit) as the user-visible delivery, respond in chat with NO_REPLY (unless you need to include additional results/details beyond what the edit shows).
Duplicate / stale callbacks
If a callback arrives after the message was already finalized (buttons removed / selection committed),
do nothing:
- - No extra message
- No additional edits
- Just silently ignore
OpenClaw message tool pattern
When using
functions.message with
action=send, include a
buttons grid.
Recommended layouts:
2-button (binary)
Row 1: ["Yes"] ["No"]
3-button (decision + defer)
Row 1: ["Do it"] ["Not now"]
Row 2: ["More info"]
A/B/C
Row 1: ["A"] ["B"] ["C"]
Copy-ready micro-templates (Telegram)
Confirm action
Text: "Want me to proceed with
?"
Buttons: [Proceed] [Hold]
Pick next step
Text: "Pick the next move:"
Buttons: [Option A] [Option B] [Option C] [Not now]
Scheduling
Text: "When should I remind you?"
Buttons: [15m] [1h] [Tonight] [Tomorrow]
Notes
- - If a button-triggered flow will branch, keep the first message short; put details in the follow-up after the click.
- Multi-step flows: (1) edit prior message to commit selection, then (2) send the next question with buttons. Don’t narrate the selection separately.
- Keep
callback_data stable and unique per flow step (e.g., flow_step_choice).
Telegram 内联按钮
默认规则
在
Telegram 上发送主动消息或要求 Rahul 选择/确认某项内容时,
优先使用内联按钮而非自由文本提示。
使用按钮的场景:
- - 是/否确认
- A/B(或 A/B/C)选择
- 立即执行 vs 稍后执行
- 从少数几个后续操作中选择一项
不使用按钮的场景:
- - 消息仅为信息性内容(无需操作)
- 用户需要粘贴/输入值(此时应要求文本输入)
- 选项超过5个(总结并提供显示更多)
按钮设计
- - 按钮标签保持简短(1–4个词)
- 2–4个按钮为理想数量
- 在适当时始终包含安全退出选项:
- 现在不要 / 稍后 / 跳过
按钮选择后(自动处理)
Telegram 不支持在普通机器人消息中设置任意文本颜色。为使选择
视觉上突出,点击后自动执行以下操作:
1)
编辑原始消息,移除内联键盘
2) 使用表情符号/符号(根据含义选择)附加一条醒目的选择行
表情符号映射(标准)
- - ✅ / 🟩 = 批准 / 是 / 继续 / 确认
- 🟥 = 否 / 取消 / 停止
- ⬛ = 稍后 / 跳过 / 推迟
不要发送额外的后续消息来重复选择内容——编辑已足够,除非有额外的上下文或结果需要报告。
工具规则: 如果你使用 functions.message(发送/编辑)作为用户可见的传递方式,在聊天中回复 NO_REPLY(除非你需要包含编辑内容之外的其他结果/详情)。
重复/过期的回调
如果回调在消息已最终确定后(按钮已移除/选择已提交)到达,
不执行任何操作:
OpenClaw 消息工具模式
使用 functions.message 且 action=send 时,包含一个 buttons 网格。
推荐布局:
2按钮(二选一)
第1行:[是] [否]
3按钮(决策+推迟)
第1行:[执行] [现在不要]
第2行:[更多信息]
A/B/C
第1行:[A] [B] [C]
可直接复用的微模板(Telegram)
确认操作
文本:要我继续执行<操作>吗?
按钮:[继续] [暂缓]
选择下一步
文本:选择下一步操作:
按钮:[选项A] [选项B] [选项C] [现在不要]
时间安排
文本:什么时候提醒你?
按钮:[15分钟] [1小时] [今晚] [明天]
注意事项
- - 如果按钮触发的流程会产生分支,保持第一条消息简短;在点击后的后续消息中提供详细信息。
- 多步骤流程:(1) 编辑上一条消息以确认选择,然后 (2) 发送带按钮的下一个问题。不要单独叙述选择内容。
- 保持 callbackdata 在每个流程步骤中稳定且唯一(例如 flowstep_choice)。