telegram-botBuild and manage Telegram bots via the Telegram Bot API. Create bots, send messages, handle webhooks, manage groups and channels.
Install via ClawdBot CLI:
clawdbot install Sebastian-Buitrag0/telegram-botRequires:
Build and manage Telegram bots directly from Clawdbot.
/newbot and follow the prompts to create your bot123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
export TELEGRAM_BOT_TOKEN="your-bot-token"
All requests go to:
https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/METHOD_NAME
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getMe" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getMyCommands" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/setMyCommands" \
-H "Content-Type: application/json" \
-d '{
"commands": [
{"command": "start", "description": "Start the bot"},
{"command": "help", "description": "Show help message"},
{"command": "settings", "description": "Bot settings"}
]
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"text": "Hello from Clawdbot!",
"parse_mode": "HTML"
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"text": "Choose an option:",
"reply_markup": {
"inline_keyboard": [
[{"text": "Option 1", "callback_data": "opt1"}, {"text": "Option 2", "callback_data": "opt2"}],
[{"text": "Visit Website", "url": "https://example.com"}]
]
}
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"text": "Choose from keyboard:",
"reply_markup": {
"keyboard": [
[{"text": "Button 1"}, {"text": "Button 2"}],
[{"text": "Send Location", "request_location": true}]
],
"resize_keyboard": true,
"one_time_keyboard": true
}
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendPhoto" \
-F "chat_id=CHAT_ID" \
-F "photo=@/path/to/image.jpg" \
-F "caption=Photo caption here" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendPhoto" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"photo": "https://example.com/image.jpg",
"caption": "Image from URL"
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendDocument" \
-F "chat_id=CHAT_ID" \
-F "document=@/path/to/file.pdf" \
-F "caption=Here is your document" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendLocation" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"latitude": 40.7128,
"longitude": -74.0060
}' | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates?offset=UPDATE_ID" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates?timeout=30" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/setWebhook" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhook",
"allowed_updates": ["message", "callback_query"]
}' | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getWebhookInfo" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/deleteWebhook" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getChat?chat_id=CHAT_ID" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getChatMemberCount?chat_id=CHAT_ID" | jq
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getChatAdministrators?chat_id=CHAT_ID" | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/banChatMember" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"user_id": USER_ID
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/unbanChatMember" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"user_id": USER_ID,
"only_if_banned": true
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/editMessageText" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"message_id": MESSAGE_ID,
"text": "Updated message text"
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/deleteMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"message_id": MESSAGE_ID
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/pinChatMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "CHAT_ID",
"message_id": MESSAGE_ID
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/forwardMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "TARGET_CHAT_ID",
"from_chat_id": "SOURCE_CHAT_ID",
"message_id": MESSAGE_ID
}' | jq
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/answerCallbackQuery" \
-H "Content-Type: application/json" \
-d '{
"callback_query_id": "CALLBACK_QUERY_ID",
"text": "Button clicked!",
"show_alert": false
}' | jq
HTML, Markdown, MarkdownV2<b>bold</b>
<i>italic</i>
<u>underline</u>
<s>strikethrough</s>
<code>inline code</code>
<pre>code block</pre>
<a href="https://example.com">link</a>
<tg-spoiler>spoiler</tg-spoiler>
#!/bin/bash
OFFSET=0
while true; do
UPDATES=$(curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates?offset=$OFFSET&timeout=30")
for UPDATE in $(echo "$UPDATES" | jq -c '.result[]'); do
UPDATE_ID=$(echo "$UPDATE" | jq '.update_id')
CHAT_ID=$(echo "$UPDATE" | jq '.message.chat.id')
TEXT=$(echo "$UPDATE" | jq -r '.message.text')
if [ "$TEXT" != "null" ]; then
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d "{\"chat_id\": $CHAT_ID, \"text\": \"You said: $TEXT\"}"
fi
OFFSET=$((UPDATE_ID + 1))
done
done
# 1. Send a message to your bot
# 2. Run this to see your chat ID:
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates" | jq '.result[-1].message.chat.id'
# Use @channelname or channel ID (starts with -100)
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "@your_channel_name",
"text": "Channel announcement!"
}' | jq
Generated Mar 1, 2026
Businesses can deploy a Telegram bot to handle common customer inquiries, provide automated responses, and escalate complex issues to human agents. This reduces response times and operational costs while improving customer satisfaction through 24/7 availability.
Media companies and content creators use Telegram bots to send updates, articles, or multimedia to subscribers. Bots can manage channels, schedule posts, and gather feedback, enhancing audience engagement and retention.
Organizations implement bots for internal communication, such as sending notifications, managing tasks, and coordinating events. This streamlines workflows, reduces email clutter, and keeps teams aligned in real-time.
Educational institutions and online platforms use bots to distribute course materials, quizzes, and announcements to students. Bots facilitate interactive learning, track progress, and provide instant feedback, making education more accessible.
Event organizers deploy bots to send invitations, updates, and reminders to attendees. Bots can handle registrations, answer FAQs, and provide real-time information, improving event logistics and participant experience.
Offer premium bot features like advanced analytics, custom integrations, or priority support through monthly or annual subscriptions. This model ensures recurring revenue and builds long-term customer relationships.
Provide basic bot functionality for free to attract users, then charge for advanced capabilities such as automation, API access, or enhanced security. This model drives user adoption and converts free users to paying customers.
Develop and license customizable bot solutions for businesses to rebrand and deploy under their own name. This model targets enterprises seeking tailored automation without in-house development, generating revenue through licensing fees.
💬 Integration Tip
Ensure the TELEGRAM_BOT_TOKEN environment variable is securely set and test API calls with curl before automating workflows to avoid errors.
iMessage/SMS CLI for listing chats, history, watch, and sending.
Use when you need to control Discord from Clawdbot via the discord tool: send messages, react, post or upload stickers, upload emojis, run polls, manage threads/pins/search, fetch permissions or member/role/channel info, or handle moderation actions in Discord DMs or channels.
Use when you need to control Slack from Clawdbot via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
Build or update the BlueBubbles external channel plugin for Clawdbot (extension package, REST send/probe, webhook inbound).
OpenClaw skill for designing Telegram Bot API workflows and command-driven conversations using direct HTTPS requests (no SDKs).