askill
telegram

telegramSafety 78Repository

Telegram Bot API — send messages, photos, files to users and groups

3 stars
1.2k downloads
Updated 2/28/2026

Package Files

Loading files...
SKILL.md

Telegram

Interact with Telegram using the Bot API.

Setup

  1. Check existing credentials:

    vault_get telegram_bot_token
    
  2. If not configured:

    • Talk to @BotFather on Telegram
    • Send /newbot and follow instructions
    • Copy the bot token
    • Save to vault:
      vault_save telegram_bot_token "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
      

    The token is auto-injected as $TELEGRAM_BOT_TOKEN.

Get Chat ID

# Send a message to your bot first, then:
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates" | jq '.result[-1].message.chat.id'

# For groups/channels, add bot as admin and send a message

Send Messages

# Send text message
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 DevClaw!"}'

# Markdown formatting
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "CHAT_ID",
    "text": "*Bold* _italic_ `code`",
    "parse_mode": "MarkdownV2"
  }'

# HTML formatting
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "CHAT_ID",
    "text": "<b>Bold</b> <i>italic</i> <code>code</code>",
    "parse_mode": "HTML"
  }'

Send Photos & Files

# 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": "CHAT_ID", "photo": "https://example.com/image.png"}'

# Send document
curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendDocument" \
  -F "chat_id=CHAT_ID" \
  -F "document=@/path/to/file.pdf"

Interactive Messages

# Message with inline keyboard buttons
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": "Yes", "callback_data": "yes"}, {"text": "No", "callback_data": "no"}]
      ]
    }
  }'

Get Updates (Polling)

# Get new messages
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates?offset=-1" | jq '.result'

# Get all pending updates
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates" | jq '.result[]'

Tips

  • Chat ID for users: positive number (e.g., 123456789)
  • Chat ID for groups: negative number (e.g., -100123456789)
  • Channel posts need @channelname or channel ID
  • Use parse_mode: "MarkdownV2" for rich formatting
  • Escape special chars in MarkdownV2: _ * [ ] ( ) ~ ` > # + - = | { } . !

Triggers

telegram, send telegram message, telegram bot, telegram notification, notify telegram, tg message

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

86/100Analyzed 3/1/2026

Well-structured Telegram Bot API skill with comprehensive coverage of messaging, media sharing, and interactive features. Clear setup instructions, copy-pasteable curl commands, and good organization. Includes vault integration for secure token handling and useful tips for chat IDs and formatting. High reusability as a general-purpose skill, though missing error handling and webhook setup details.

78
90
85
82
92

Metadata

Licenseunknown
Version0.1.0
Updated2/28/2026
Publisherjholhewres

Tags

api