telegram-bot-messaging – skill Agent & Tự động hóa cho agent AI
Gửi tin nhắn, tệp và cảnh báo Telegram qua bot API; đặt câu hỏi bằng nút inline và chờ phản hồi. Hỗ trợ nhiều bot, đích chat được đặt tên, và thông báo từ CI/cron/hook.
Cài skill telegram-bot-messaging bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/telegram-bot-messaging-b32fa.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /telegram-bot-messaging – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/telegram-bot-messaging-b32fa.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $telegram-bot-messaging – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/telegram-bot-messaging-b32fa.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /telegram-bot-messaging – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/telegram-bot-messaging-b32fa.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /telegram-bot-messaging – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Telegram
When to Use
- Use when you need to send a Telegram message, file, or alert from a workflow, hook, cron job, or CI pipeline
- Use when a long-running task should notify you or ask for approval on your phone (inline-button questions that wait for the answer)
- Use when wiring "notify me when done" or "ask me before proceeding" behavior into automated sessions
Send updates, alerts, and files to Telegram; read replies; run ask-and-wait
approval flows. Pure bash + curl + jq — no install beyond a bot token.
First run: bash scripts/telegram.sh setup (guided BotFather walkthrough).
Safety Gate
Before setup, sending a message or file, reading replies, or enabling a hook, obtain the
user's explicit approval for the target chat, bot account, and exact content or file. Never
send workspace, customer, credential, or secret data automatically. Treat a token as a secret:
do not echo it, commit it, or place it in shell history.
Commands
bash scripts/telegram.sh send "Deploy finished ✅" # basic alert
bash scripts/telegram.sh send "low priority" --silent # no notification sound
bash scripts/telegram.sh send "*bold* alert" --format md # MarkdownV2 (falls back to plain)
bash scripts/telegram.sh send "hi" --to alerts --bot work # named target + named bot
bash scripts/telegram.sh file report.pdf "Q3 report" # document (photos auto-detected)
bash scripts/telegram.sh read # new incoming messages since last read
ANSWER=$(bash scripts/telegram.sh ask "Deploy to prod?" --options "Yes,No" --timeout 300)
# exit 0 = answered (stdout = answer), 2 = timeoutConfig
Env vars win, then ~/.config/telegram/config (mode 600):
TELEGRAM_BOT_TOKEN=123:ABC... # default bot
TELEGRAM_CHAT_ID=987654321 # default target
BOT_ALERTS_TOKEN=456:DEF... # --bot alerts (add via: setup --bot alerts)
TARGET_FAMILY=-100987... # --to family (any chat/group/channel id)
TELEGRAM_APPROVER_IDS=123456789 # default group approver user IDs (comma-separated)
APPROVERS_FAMILY=123456789,987654321 # approvers for --to family (overrides default)Replies and answers are only accepted from configured chat IDs. Private chats preserve the
direct-chat behavior (the sender user ID must equal the chat ID). Because a group chat ID is
shared by every member, ask fails closed for groups unless TELEGRAM_APPROVER_IDS or the
target-specific APPROVERS_<NAME> explicitly lists the Telegram user IDs allowed to answer.
Claude Code hooks (settings.json)
Ping your phone when Claude needs input, and when it finishes:
{
"hooks": {
"Notification": [{"hooks": [{"type": "command",
"command": "bash ~/.claude/skills/telegram/scripts/telegram.sh send \"🔔 Claude needs input in $(basename \\\"$PWD\\\")\""}]}],
"Stop": [{"hooks": [{"type": "command",
"command": "bash ~/.claude/skills/telegram/scripts/telegram.sh send \"✅ Claude finished in $(basename \\\"$PWD\\\")\" --silent"}]}]
}
}Approval gate in any script/automation:
if [ "$(bash scripts/telegram.sh ask 'Deploy to prod?' --options 'Yes,No')" = "Yes" ]; then
./deploy.sh
fiLimitations
- Telegram is a third-party service: message and file contents leave the local machine and may
be retained under Telegram's policies.
- This skill cannot verify that a chat ID belongs to the intended recipient; confirm the target
before every new destination or automation.
- Bot tokens grant control of the bot. Store them only in a protected local secret store or
mode-600 configuration file. The script supplies token-bearing API URLs to curl through
stdin rather than process arguments; rotate a token if exposure is suspected.
- Do not use the examples to create unattended notifications or approval flows without the
user's explicit, current authorization.
Operational limits
Setup currently discovers the latest pending chat; verify its numeric ID through a trusted channel before allowing the confirmation send. Do not use setup with unverified pending senders. The script is not a secure approval system: one process per bot is required, ask/read share and consume updates, and webhook mode conflicts with getUpdates. Text answers must reply directly to the question; an allowed sender's unrelated message is not approval. Bind production approvals to the exact action/artifact/destination and verify the response identity, freshness and chosen option in the caller; timeout/error is never consent. No auto-retry on uncertain sends.
Local cursors/config need a private owned directory and exclusive access; do not run on attacker-controlled paths. Bash character splitting can cut markup/Unicode units, Telegram photos/captions have separate limits, and sending a GIF/WebP as photo may fail or alter it: prefer document mode where fidelity matters. Message/caption/argv and logs may expose private data. Truncation/partial multi-message delivery must be reported; formatting fallback does not guarantee delivery. No setup/message/file/read/hook was performed in this review.
Skill liên quan
- tiktok-automation – Tự động hóa tác vụ TikTok qua Rube MCP (Composio): tải lên/đăng video, đăng ảnh, quản lý…
- tmux – Quản lý session, window và pane trong tmux một cách thành thạo cho việc ghép nhiều…
- todoist-automation – Tự động hóa quản lý tác vụ Todoist: task, project, section, lọc và các thao tác hàng…
- tokenleak – Quy tắc tiết kiệm token cho coding agent: giảm context gửi lại ở mỗi lần gọi sau (đọc…
- tree-ring-memory – Dùng Tree Ring Memory cho công việc vòng đời bộ nhớ của AI agent ưu tiên chạy cục bộ…
- trello-automation – Tự động hóa bảng, thẻ và quy trình Trello qua Rube MCP (Composio). Tạo thẻ, quản lý danh…
- twitter-automation – Tự động hóa tác vụ Twitter/X qua Rube MCP (Composio): bài đăng, tìm kiếm, người dùng…
- unified-ai-gateway – Vận hành và đánh giá Unified AI System qua 15 công cụ MCP có quản trị, bao gồm cải thiện…