Install
openclaw skills install telegram-bot-apiBuild Telegram bots with correct API calls, message formatting, keyboards, and webhook setup.
openclaw skills install telegram-bot-apiOn first use, read setup.md for integration guidelines.
User needs to interact with the Telegram Bot API. Building bots, sending messages, handling updates, setting up webhooks, creating keyboards, or managing bot commands.
Memory lives in ~/telegram-bot-api/. See memory-template.md for structure.
~/telegram-bot-api/
├── memory.md # Bot tokens, preferences, defaults
├── bots/ # Per-bot configurations
│ └── {botname}.md # Token, webhook URL, defaults
└── templates/ # Reusable message templates
| Topic | File |
|---|---|
| Setup process | setup.md |
| Memory template | memory-template.md |
| All API methods | methods.md |
| Message formatting | formatting.md |
| Keyboards & buttons | keyboards.md |
| Webhooks & polling | webhooks.md |
| Media handling | media.md |
| Error codes | errors.md |
All requests go to:
https://api.telegram.org/bot{TOKEN}/{METHOD}
Never expose the token in logs or user-visible output.
| Method | Required | Optional (common) |
|---|---|---|
| sendMessage | chat_id, text | parse_mode, reply_markup, disable_notification |
| sendPhoto | chat_id, photo | caption, parse_mode |
| sendDocument | chat_id, document | caption, thumbnail |
| getUpdates | — | offset, limit, timeout |
| setWebhook | url | certificate, max_connections |
| deleteWebhook | — | drop_pending_updates |
| getMe | — | — |
| Format | Use when | Escape chars |
|---|---|---|
MarkdownV2 | Rich formatting needed | _*[]()~\>#+-= |
HTML | Complex nesting, safer | <>& |
| None | Plain text only | None |
Default to HTML — fewer escape issues than MarkdownV2.
| Type | Format | Example |
|---|---|---|
| User | Positive integer | 123456789 |
| Group | Negative integer | -123456789 |
| Supergroup/Channel | -100 prefix | -1001234567890 |
| Scope | Limit |
|---|---|
| Same chat | 1 msg/sec |
| Different chats | 30 msg/sec |
| Groups | 20 msg/min per group |
| Bulk notifications | Use sendMessage with different chat_ids |
When hitting 429 errors, use exponential backoff starting at retry_after seconds.
| Type | Limit |
|---|---|
| Text message | 4096 chars |
| Caption | 1024 chars |
| Callback data | 64 bytes |
| Inline query | 256 chars |
Split long messages at sentence boundaries, not mid-word.
Inline keyboards (in message):
callback_data for bot actionsurl for external linksReply keyboards (below input):
one_time_keyboard: true to hide after useresize_keyboard: true for better mobile UX| Endpoint | Data Sent | Purpose |
|---|---|---|
| https://api.telegram.org/bot{TOKEN}/* | Messages, media, commands | All bot operations |
No other data is sent externally. Bot token is required for all requests.
Data that leaves your machine:
Data that stays local:
~/telegram-bot-api/This skill does NOT:
By using this skill, data is sent to Telegram's Bot API servers. Only install if you trust Telegram with your bot's messages.
Install with clawhub install <slug> if user confirms:
api — REST API best practiceshttp — HTTP protocol essentialsjson — JSON parsing and manipulationclawhub star telegram-bot-apiclawhub sync