Telegram Bot API
Build Telegram bots with correct API calls, message formatting, keyboards, and webhook setup.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/telegram-bot-apiSetup
On first use, read setup.md for integration guidelines.
When to Use
User needs to interact with the Telegram Bot API. Building bots, sending messages, handling updates, setting up webhooks, creating keyboards, or managing bot commands.
Architecture
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
Quick Reference
| 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 |
Core Rules
1. API Base URL
All requests go to:
https://api.telegram.org/bot{TOKEN}/{METHOD}
Never expose the token in logs or user-visible output.
2. Required Parameters by Method
| 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 | — | — |
3. Parse Mode Selection
| 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.
4. Chat ID Types
| Type | Format | Example |
|---|---|---|
| User | Positive integer | 123456789 |
| Group | Negative integer | -123456789 |
| Supergroup/Channel | -100 prefix | -1001234567890 |
5. Rate Limits
| 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.
6. Message Length Limits
| 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.
7. Keyboard Best Practices
Inline keyboards (in message):
- Max 8 buttons per row
- Max 100 buttons total
- Use
callback_datafor bot actions - Use
urlfor external links
Reply keyboards (below input):
- Use for frequent options
one_time_keyboard: trueto hide after useresize_keyboard: truefor better mobile UX
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-telegram-bot-api": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.