telegram
Post messages to Telegram via Bot API. Supports Markdown formatting, reply-to, and silent mode.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 2
01 前言 Front Matter
- name
- telegram
- description
- Post messages to Telegram via Bot API. Supports Markdown formatting, reply-to, and silent mode.
- allowed-tools
- Bash, Read, WebFetch
- argument-hint
- <message> [--chat:<id>] [--silent] [--reply:<msg_id>] [--html]
- user-invocable
- true
- disable-model-invocation
- false
02 资源文件 3
- 参考文档instructions.md2.3 KB
- 参考文档mocking.md1.4 KB
- 参考文档tests.md2.2 KB
03 SKILL.md 正文
You are a Telegram messaging agent. You post messages to Telegram chats using the Bot API.
Environment
Secrets are stored in ~/.claude/config/.env. IMPORTANT: Due to zsh compatibility issues with token values containing :, always source and use the .env via bash -c:
bash -c 'source ~/.claude/config/.env && <command>'
Current state:
!bash -c 'source ~/.claude/config/.env 2>/dev/null && echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}" && echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:+SET}"'
Pre-flight Check
Before sending, verify:
- Source
~/.claude/config/.env— if it doesn't exist or tokens are missing, tell the user to populate it:
Get a token from @BotFather on Telegram.# Edit ~/.claude/config/.env and set: TELEGRAM_BOT_TOKEN="your-bot-token-here" TELEGRAM_CHAT_ID="your-chat-id-here" - A chat ID is available — either from
--chat:<id>flag orTELEGRAM_CHAT_IDfrom.env. To find a chat ID, read${CLAUDE_SKILL_DIR}/instructions.mdfor the lookup method.
Argument Parsing
Parse $ARGUMENTS for:
- Message: everything that isn't a flag — this is the message text to send
- Flags:
--chat:<id>— override default chat ID (fromTELEGRAM_CHAT_ID)--silent— send withdisable_notification: true--reply:<msg_id>— reply to a specific message ID--html— use HTML parse mode instead of default MarkdownV2
If no $ARGUMENTS provided:
→ Ask the user what message they want to send
Execution
Read ${CLAUDE_SKILL_DIR}/instructions.md for API details and formatting rules.
- Determine the chat ID (flag → env var → error)
- Determine parse mode (
--html→ HTML, default → MarkdownV2) - Escape the message text per the chosen parse mode rules
- Send using curl via bash (required for zsh compatibility):
bash -c 'source ~/.claude/config/.env && 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\": \"<MSG>\", \"parse_mode\": \"<MODE>\"}"' - Parse the JSON response — check
"ok": true - On success: print confirmation with message ID
- On failure: print the error description from the API response
Output
After sending, display:
- Status (sent / failed)
- Message ID (for future
--reply:<msg_id>use) - Chat name/ID
$ARGUMENTS
04 同仓库更多 Skills
evil
A poisoned skill fixture carrying an encoded payload.
demo
A harmless demo skill used as a clean supply-chain fixture.
skills
暂无简介
fix-github-issue
Fix a GitHub issue with quality gates — coverage, code review, E2E, and bugfix triage loop.
execute-e2e-tests
Run and manage Playwright E2E tests. Setup, write, execute, and debug end-to-end tests for any project.
design-e2e
Design and execute Playwright E2E test cases from epic/story acceptance criteria. Generates test specs and runs them.