Files
reporting-governance-plugin/skills/telegram-inline-buttons/SKILL.md

127 lines
4.4 KiB
Markdown

---
name: telegram-inline-buttons
description: Use when sending proactive Telegram messages that ask Eric to confirm, choose, defer, or pick from a few next actions; especially for yes/no, A/B/C, do-now-vs-later, short multi-step button flows, implicit yes/no prompts like 如果你要..., and numbered option lists like 1.xxx / 2.ooo / 3.yyy that should be converted into inline buttons.
---
# Telegram Inline Buttons
Prefer inline buttons over free-text prompts when sending a proactive Telegram message that expects a choice.
## Use buttons for
- Yes / No confirmations
- Implicit yes / no prompts like `如果你要...`
- A / B / C choices
- Do it now vs later
- Picking one of a few next actions
- Numbered option lists like `1.xxx`, `2.ooo`, `3.yyy`
## Do not use buttons for
- Purely informational messages
- Input that requires typed text
- More than 5 options
If there are >5 options, summarize and offer a `Show more` button.
## Trigger interpretation
Treat these as button-worthy even if they are not written as direct questions:
- `如果你要,我可以現在幫你處理`
- `如果你要我繼續,我就直接做`
- `如果你要 ooooxxxxx`
These are usually implicit binary decisions and should default to inline buttons such as `[好,繼續] [先不要]` rather than requiring free-text confirmation.
## Button design
- Keep labels short: 1-4 words
- 2-4 buttons is ideal
- Include a safe exit when appropriate: `Not now`, `Cancel`, `Later`, `Skip`
- Keep `callback_data` stable and unique per flow step, e.g. `reminder_time_15m`, `deploy_confirm_yes`
- When the source prompt is a numbered list, convert each visible option into a short button label while preserving the original order
- When the source prompt is implicit yes/no, convert it into a clear binary choice without changing the underlying intent
Recommended layouts:
- Binary: one row `[Yes] [No]`
- Decision + defer: row 1 `[Do it] [Not now]`, row 2 `[More info]`
- A/B/C: one row `[A] [B] [C]`
- Numbered list: `[1] [2] [3]` or short labels derived from each option
- Implicit yes/no: `[好,繼續] [先不要]`, `[要] [不用]`, `[現在做] [稍後]`
## Telegram message tool pattern
For user-visible delivery, use `message(action="send")` with `buttons`.
Example shape:
```json
{
"action": "send",
"channel": "telegram",
"target": "...",
"message": "Want me to proceed?",
"buttons": [[
{"text": "Proceed", "callback_data": "deploy_confirm_yes", "style": "primary"},
{"text": "Hold", "callback_data": "deploy_confirm_no"}
]]
}
```
## After a button click
Telegram bot messages do not support arbitrary text color. To make the selection stand out:
1. Edit the original message
2. Remove the inline keyboard
3. Append one short committed-selection line with emoji
Standard emoji mapping:
- `✅` or `🟩` = yes / approve / proceed / confirm
- `🟥` = no / cancel / stop
- `⬛️` = later / skip / defer
Do **not** send a separate follow-up that only repeats the selection. Editing is enough unless you also need to report results or ask the next question.
## Multi-step flows
For branching flows:
1. Edit the prior message to commit the selection
2. Send the next question with fresh buttons
3. Do not narrate the previous selection again
Keep the first message short. Put details in the next step after the click.
## Duplicate / stale callbacks
If a callback arrives after the message is already finalized:
- Do nothing
- No extra message
- No further edits
- Silently ignore it
## Tooling rule
If `message(send/edit)` delivered the user-visible response, reply in chat with `NO_REPLY` unless you must add extra context beyond what the message edit already shows.
## Copy-ready templates
### Confirm action
Text: `Want me to proceed with <action>?`
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]`
### Numbered options
Text:
```text
Pick one:
1. xxx
2. ooo
3. yyy
```
Buttons: `[1] [2] [3]` or `[xxx] [ooo] [yyy]`
### Implicit yes/no
Text: `如果你要,我可以現在幫你處理。`
Buttons: `[好,繼續] [先不要]`
## Decision rule
Default to buttons whenever Eric is being asked to choose, confirm, defer, or select the next action on Telegram. This includes numbered lists that would otherwise require a reply like `1`, `2`, or `3`, and implicit yes/no prompts that would otherwise require a reply like `好` or `不用`.