Document inline buttons configuration for Telegram (#984)
This commit is contained in:
committed by
GitHub
parent
af370ab23e
commit
7c38b535f6
@@ -194,6 +194,68 @@ Telegram forum topics include a `message_thread_id` per message. Clawdbot:
|
|||||||
|
|
||||||
Private chats can include `message_thread_id` in some edge cases. Clawdbot keeps the DM session key unchanged, but still uses the thread id for replies/draft streaming when it is present.
|
Private chats can include `message_thread_id` in some edge cases. Clawdbot keeps the DM session key unchanged, but still uses the thread id for replies/draft streaming when it is present.
|
||||||
|
|
||||||
|
## Inline Buttons
|
||||||
|
|
||||||
|
Telegram supports inline keyboards with callback buttons. Enable this feature via capabilities:
|
||||||
|
|
||||||
|
```json5
|
||||||
|
{
|
||||||
|
"channels": {
|
||||||
|
"telegram": {
|
||||||
|
"capabilities": ["inlineButtons"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For per-account configuration:
|
||||||
|
```json5
|
||||||
|
{
|
||||||
|
"channels": {
|
||||||
|
"telegram": {
|
||||||
|
"accounts": {
|
||||||
|
"main": {
|
||||||
|
"capabilities": ["inlineButtons"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sending buttons
|
||||||
|
|
||||||
|
Use the message tool with the `buttons` parameter:
|
||||||
|
|
||||||
|
```json5
|
||||||
|
{
|
||||||
|
"action": "send",
|
||||||
|
"channel": "telegram",
|
||||||
|
"to": "123456789",
|
||||||
|
"message": "Choose an option:",
|
||||||
|
"buttons": [
|
||||||
|
[
|
||||||
|
{"text": "Yes", "callback_data": "yes"},
|
||||||
|
{"text": "No", "callback_data": "no"}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{"text": "Cancel", "callback_data": "cancel"}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When a user clicks a button, the callback data is sent back to the agent as a message with the format:
|
||||||
|
`callback_data: value`
|
||||||
|
|
||||||
|
### Configuration options
|
||||||
|
|
||||||
|
Telegram capabilities can be configured at two levels:
|
||||||
|
|
||||||
|
- `channels.telegram.capabilities`: Global default capability list applied to all Telegram accounts unless overridden.
|
||||||
|
- `channels.telegram.accounts.<account>.capabilities`: Per-account capabilities that override or extend the global defaults for that specific account.
|
||||||
|
|
||||||
|
Use the global setting when all Telegram bots/accounts should behave the same. Use per-account configuration when different bots need different behaviors (for example, one account only handles DMs while another is allowed in groups or has extra capabilities).
|
||||||
## Access control (DMs + groups)
|
## Access control (DMs + groups)
|
||||||
|
|
||||||
### DM access
|
### DM access
|
||||||
@@ -392,6 +454,8 @@ Provider options:
|
|||||||
- `channels.telegram.groups.<id>.enabled`: disable the group when `false`.
|
- `channels.telegram.groups.<id>.enabled`: disable the group when `false`.
|
||||||
- `channels.telegram.groups.<id>.topics.<threadId>.*`: per-topic overrides (same fields as group).
|
- `channels.telegram.groups.<id>.topics.<threadId>.*`: per-topic overrides (same fields as group).
|
||||||
- `channels.telegram.groups.<id>.topics.<threadId>.requireMention`: per-topic mention gating override.
|
- `channels.telegram.groups.<id>.topics.<threadId>.requireMention`: per-topic mention gating override.
|
||||||
|
- `channels.telegram.capabilities`: Enable channel features (e.g., "inlineButtons").
|
||||||
|
- `channels.telegram.accounts.<account>.capabilities`: Per-account capabilities.
|
||||||
- `channels.telegram.replyToMode`: `off | first | all` (default: `first`).
|
- `channels.telegram.replyToMode`: `off | first | all` (default: `first`).
|
||||||
- `channels.telegram.textChunkLimit`: outbound chunk size (chars).
|
- `channels.telegram.textChunkLimit`: outbound chunk size (chars).
|
||||||
- `channels.telegram.streamMode`: `off | partial | block` (draft streaming).
|
- `channels.telegram.streamMode`: `off | partial | block` (draft streaming).
|
||||||
|
|||||||
Reference in New Issue
Block a user