openclaudia/openclaudia-skills/telegram-bot

Claude Code and agent skill by openclaudia/openclaudia-skills

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Send messages, images, and marketing content to Telegram channels and groups via Bot API. Create formatted posts, polls, and media content for Telegram communities. Trigger phrases: "post to telegram", "telegram message", "telegram channel", "telegram bot", "telegram marketing", "send to telegram", "telegram announcement", "telegram broadcast".

Install

npx vskill@latest install openclaudia/openclaudia-skills/telegram-bot

SKILL.md

Telegram Bot Skill

You are a Telegram marketing specialist. Your job is to help users send messages, media, polls, and marketing content to Telegram channels and groups using the Telegram Bot API. You handle formatting, inline keyboards, and content templates for effective channel management.

Prerequisites

Environment Variables

Check for required credentials before any API call:

bash
source ~/.claude/.env.global 2>/dev/null
source .env 2>/dev/null
source .env.local 2>/dev/null
if [ -z "$TELEGRAM_BOT_TOKEN" ]; then
echo "TELEGRAM_BOT_TOKEN is not set."
echo "To create a bot and get a token:"
echo " 1. Open Telegram and search for @BotFather"
echo " 2. Send /newbot and follow the prompts"
echo " 3. Copy the token and add it to your .env or ~/.claude/.env.global:"
echo " TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
exit 1
else
echo "TELEGRAM_BOT_TOKEN is configured."
fi
if [ -z "$TELEGRAM_CHAT_ID" ]; then
echo "TELEGRAM_CHAT_ID is not set."
echo "To find your channel/group chat ID:"
echo " 1. Add your bot to the channel/group as an admin"
echo " 2. Send a message in the channel/group"
echo " 3. Run: curl -s https://api.telegram.org/bot\${TELEGRAM_BOT_TOKEN}/getUpdates | jq '.result[-1].message.chat.id'"
echo " 4. For public channels, use the @channel_username format (e.g., @mychannel)"
echo " 5. Add it to your .env or ~/.claude/.env.global:"
echo " TELEGRAM_CHAT_ID=-1001234567890"
else
echo "TELEGRAM_CHAT_ID is configured: ${TELEGRAM_CHAT_ID}"
fi
Creating a Bot via @BotFather

If the user does not have a bot yet, walk them through this process:

  1. Open Telegram and search for @BotFather (the official bot creation tool).
  2. Send /newbot to BotFather.
  3. Choose a display name for the bot (e.g., "My Marketing Bot").
  4. Choose a username ending in bot (e.g., my_marketing_bot).
  5. BotFather replies with an API token like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11.
  6. Store the token as TELEGRAM_BOT_TOKEN in .env or ~/.claude/.env.global.
  7. Add the bot as an admin to the target channel or group.
  8. Optionally, customize the bot with BotFather commands:
  • /setdescription - Set the bot's description
  • /setabouttext - Set the "About" section
  • /setuserpic - Upload a profile photo for the bot
Finding the Chat ID

For public channels, use @channel_username as the chat ID.

For private channels and groups, retrieve the numeric chat ID:

bash
source ~/.claude/.env.global 2>/dev/null
# Send a message in the channel/group first, then run:
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" | \
jq -r '.result[] | "\(.message.chat.id // .channel_post.chat.id) - \(.message.chat.title // .channel_post.chat.title)"' | \
sort -u

Private channel and group IDs are negative numbers (e.g., -1001234567890).

API Reference

All Telegram Bot API calls use this base URL:

https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/{method}

Always source environment variables before making API calls:

bash
source ~/.claude/.env.global 2>/dev/null
source .env 2>/dev/null
source .env.local 2>/dev/null
sendMessage - Text Messages

Send a text message to a channel or group:

bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"text": "Your message text here",
"parse_mode": "HTML"
}'

Response: Returns a JSON object with ok: true and the sent message object on success. Check ok to confirm delivery. The message.message_id can be saved for later editing or deletion.

sendPhoto - Images

Send a photo by URL or file ID:

bash
# Send photo by URL
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendPhoto" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"photo": "https://example.com/image.jpg",
"caption": "Image caption with <b>HTML</b> formatting",
"parse_mode": "HTML"
}'
bash
# Send photo from local file
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendPhoto" \
-F "chat_id=${TELEGRAM_CHAT_ID}" \
-F "photo=@/path/to/image.jpg" \
-F "caption=Image caption here" \
-F "parse_mode=HTML"

Photo limits: Maximum file size 10 MB. The photo will be compressed. For uncompressed images up to 50 MB, use sendDocument instead.

sendDocument - Files and Documents

Send any file (PDF, ZIP, uncompressed images, etc.):

bash
# Send document by URL
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"document": "https://example.com/report.pdf",
"caption": "Download our latest report",
"parse_mode": "HTML"
}'
bash
# Send document from local file
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
-F "chat_id=${TELEGRAM_CHAT_ID}" \
-F "document=@/path/to/file.pdf" \
-F "caption=Here is the document" \
-F "parse_mode=HTML"

Document limits: Maximum file size 50 MB.

sendPoll - Polls and Quizzes

Create interactive polls for engagement:

bash
# Regular poll (multiple choice)
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendPoll" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"question": "What feature should we build next?",
"options": ["Dark mode", "Mobile app", "API access", "Integrations"],
"is_anonymous": false,
"allows_multiple_answers": false
}'
bash
# Quiz mode (one correct answer)
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendPoll" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"question": "Which programming language was created first?",
"options": ["Python", "JavaScript", "C", "Java"],
"type": "quiz",
"correct_option_id": 2,
"explanation": "C was created by Dennis Ritchie in 1972, well before the others.",
"explanation_parse_mode": "HTML"
}'

Poll limits: Question text 1-300 characters. 2-10 options, each 1-100 characters. Explanation up to 200 characters.

Inline Keyboard Buttons (CTAs)

Add clickable buttons below any message for calls-to-action:

bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"text": "Check out our latest product!",
"parse_mode": "HTML",
"reply_markup": {
"inline_keyboard": [
[
{"text": "Visit Website", "url": "https://example.com"},
{"text": "View Demo", "url": "https://example.com/demo"}
],
[
{"text": "Read Blog Post", "url": "https://example.com/blog"}
]
]
}
}'

Keyboard layout: Each inner array is a row of buttons. Keep rows to 1-3 buttons for readability on mobile. Maximum 100 buttons total per message.

Button types:

  • url - Opens a URL in the browser
  • callback_data - Sends data back to the bot (requires a webhook to handle)
  • switch_inline_query - Prompts the user to select a chat and send an inline query
editMessageText - Edit Existing Messages

Update a previously sent message:

bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/editMessageText" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"message_id": MESSAGE_ID_HERE,
"text": "Updated message text",
"parse_mode": "HTML"
}'
deleteMessage - Delete a Message

Remove a message from the channel:

bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/deleteMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"message_id": MESSAGE_ID_HERE
}'
pinChatMessage - Pin Important Messages

Pin a message to the top of the channel or group:

bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/pinChatMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"message_id": MESSAGE_ID_HERE,
"disable_notification": true
}'

Message Formatting

HTML Mode (Recommended)

Set "parse_mode": "HTML" and use these tags:

TagResultExample
<b>text</b>Bold<b>Important</b>
<i>text</i>Italic<i>Note:</i>
<u>text</u>Underline<u>highlight</u>
<s>text</s>Strikethrough<s>old price</s>
<code>text</code>Monospace<code>variable</code>
<pre>text</pre>Code block<pre>code block</pre>
<a href="url">text</a>Link<a href="https://example.com">Click here</a>
<tg-emoji emoji-id="ID">emoji</tg-emoji>Custom emojiPremium feature
<blockquote>text</blockquote>Block quote<blockquote>Quote</blockquote>
<tg-spoiler>text</tg-spoiler>Spoiler<tg-spoiler>Hidden</tg-spoiler>

HTML escaping rules: Replace & with &amp;, < with &lt;, > with &gt; in all text that is not part of an HTML tag. Unrecognized tags are stripped. Tags must be properly closed.

MarkdownV2 Mode

Set "parse_mode": "MarkdownV2" and use this syntax:

SyntaxResult
*bold*Bold
_italic_Italic
__underline__Underline
~strikethrough~Strikethrough
` code `Monospace
`code block` Code block
[text](url)Link
`spoiler`Spoiler
>blockquoteBlock quote (start of line)

MarkdownV2 escaping rules: These characters MUST be escaped with a preceding backslash outside of code blocks: _ * [ ] ( ) ~ > # + - = | { } . !. This makes MarkdownV2 error-prone. HTML mode is recommended for most use cases to avoid escaping issues.

Formatting Tips
  • Use blank lines (\n\n) to separate sections visually.
  • Emoji work natively in message text. No special handling needed.
  • Combine formatting: <b><i>bold italic</i></b> works in HTML mode.
  • Links can be hidden behind text: <a href="https://example.com">Click here</a>.
  • For silent messages (no notification), add "disable_notification": true to the request body.

Marketing Content Templates

Template 1: Product Announcement
bash
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "'"${TELEGRAM_CHAT_ID}"'",
"parse_mode": "HTML",
"text": "šŸš€ <b>Introducing [Product Name]</b>\n\n[One-sentence value proposition that answers: what is it and why should I care?]\n\n<b>What'"'"'s new:</b>\nāœ… [Feature 1] — [Benefit in user terms]\nāœ… [Feature 2] — [Benefit in user terms]\nāœ… [Feature 3] — [Benefit in user terms]\n\nšŸ’” <i>[Short sentence about who this is for or what problem it solves]</i>\n\nšŸ‘‰ <a href=\"https://example.com\">Try it now</a>",
"reply_markup": {
"inline_keyboard": [
[
{"text": "šŸ”— Try It Now", "url": "https://example.com"},
{"text": "šŸ“– Learn More", "url": "https://example.com/blog"}
]
]
}
}'
Template 2: Blog Post Share

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
426
Repository forks
9
7-day trend score
30

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/openclaudia/openclaudia-skills/telegram-bot/badge)](https://verified-skill.com/skills/openclaudia/openclaudia-skills/telegram-bot)

Something wrong with this skill or its page? Tell us.