/SKILL.md
Comprehensive Telegram Bot management for Claude agents. Use when the user needs to: (1) Create or configure Telegram bots, (2) Send messages to users or groups BY NAME (e.g. 'message John' or 'send to the dev team'), (3) Manage contacts, (4) Join groups or channels, (5) Handle Telegram notifications, or any other Telegram bot automation tasks. Users naturally reference contacts by name, NOT by chat ID.
npx skillsauth add teamily-ai/telegram-bot-skill telegram-bot-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables Claude to act as a Telegram bot, managing accounts, sending messages, and automating Telegram interactions with a natural, name-based contact system.
Before using this skill, ensure the following are installed:
pip install python-telegram-bot python-dotenv
When the user wants to create or configure a Telegram bot:
Guide them to create a bot via @BotFather on Telegram:
/newbot to @BotFatherRun the initialization script:
python scripts/init_bot.py
This will prompt for the bot token and create a .env file with configuration.
Verify the bot is working:
python scripts/test_connection.py
Import contacts (IMPORTANT - do this early):
# First, have users message the bot
# Then import all chats as named contacts
python scripts/contacts.py import
CRITICAL: Users speak naturally using names like "message John" or "chat with the dev team", NOT "send to chat_id 123456789". Always use the contact system to enable natural interactions.
Import contacts from recent chats (recommended first step):
python scripts/contacts.py import
Add a contact manually:
python scripts/contacts.py add "John" 123456789
python scripts/contacts.py add "Dev Team" -100123456789 --type supergroup
List all contacts:
python scripts/contacts.py list
Search for a contact:
python scripts/contacts.py search john
Get chat ID by name (if needed):
python scripts/contacts.py get "John"
Remove a contact:
python scripts/contacts.py remove "John"
IMPORTANT: When users say "message John" or "send to the team", use contact names with --to:
To a contact by name (PREFERRED METHOD):
python scripts/send_message.py --to "John" -m "Hey, how are you?"
python scripts/send_message.py --to "Dev Team" -m "Deployment complete!"
python scripts/send_message.py --to "mom" -m "Love you!"
To a chat ID (only if contact not saved):
python scripts/send_message.py --to 123456789 -m "Hello!"
Using default contact:
python scripts/send_message.py --use-default -m "Quick update"
With formatting:
python scripts/send_message.py --to "John" -m "**Important** update" --format markdown
python scripts/send_message.py --to "Team" -m "<b>Bold</b> text" --format html
Get bot information:
python scripts/bot_info.py
List recent chats (for debugging):
python scripts/list_chats.py
Get specific chat info:
python scripts/get_chat_info.py --chat-id 123456789
To join a group or channel:
python scripts/contacts.py import
python scripts/send_message.py --to "Project Team" -m "Hello everyone!"
Send formatted messages:
python scripts/send_message.py --to "John" -m "**Bold** _italic_" --format markdown
Send messages with buttons:
python scripts/send_with_buttons.py --to "John" -m "Choose option" --buttons "Yes,No,Maybe"
Send files/photos:
python scripts/send_file.py --to "John" --file path/to/file.pdf
python scripts/send_photo.py --to "John" --photo path/to/photo.jpg --caption "Check this out!"
When users make requests in natural language, translate them to contact-based commands:
| User Says | Command to Use |
|-----------|----------------|
| "Message John" | send_message.py --to "John" -m "..." |
| "Send this to the dev team" | send_message.py --to "dev team" -m "..." |
| "Chat with mom" | send_message.py --to "mom" -m "..." |
| "Tell Sarah about the update" | send_message.py --to "Sarah" -m "update" |
| "Notify everyone in the group" | send_message.py --to "group name" -m "..." |
All bot configuration is stored in .env:
TELEGRAM_BOT_TOKEN=your_bot_token_here
DEFAULT_CHAT_ID=your_default_chat_id
Contacts are stored in contacts.json (created automatically).
Always Use Contact Names: When a user says "message John", use --to "John" not --to 123456789. This is more natural and user-friendly.
Contact Import Workflow:
python scripts/contacts.py import to auto-import all chats with namesNatural Language: Translate natural requests to commands:
--to "dev team"--to "John"Group IDs: Group chat IDs are negative numbers (e.g., -100123456789). The contact system handles this automatically.
Privacy Mode: By default, bots in groups only receive messages that:
/ (commands)To receive all messages, disable privacy mode via @BotFather.
Rate Limits: Telegram enforces rate limits (30 messages/second). The scripts include basic rate limiting.
Contact Names Are Case-Insensitive: "John", "john", and "JOHN" all work the same way.
For detailed API information and advanced usage:
references/telegram_api.md for complete Telegram Bot API referencereferences/examples.md for common usage patterns and code examples.env file or contacts.json (contains chat IDs)Contact not found:
python scripts/contacts.py list to see all contactspython scripts/contacts.py import to import from recent chatspython scripts/contacts.py add "Name" chat_idBot not receiving messages:
"Unauthorized" errors:
.envCannot send to group:
python scripts/contacts.py import# 1. Initialize bot
python scripts/init_bot.py
# 2. Have people message your bot or add it to groups
# 3. Import all contacts with names
python scripts/contacts.py import
# 4. Now send messages naturally by name
python scripts/send_message.py --to "John" -m "Hey!"
python scripts/send_message.py --to "Dev Team" -m "Deploy complete"
python scripts/send_message.py --to "mom" -m "Love you"
# In your Python code
import subprocess
def message_contact(name, text):
"""Send message to a contact by name"""
subprocess.run([
'python', 'scripts/send_message.py',
'--to', name,
'-m', text
])
# Usage
message_contact("John", "Task completed!")
message_contact("Dev Team", "Build successful!")
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.