用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/laude-institute/headlong --skill telegram命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | telegram |
| description | Send and receive messages via the Telegram Bot API using curl |
Use this skill to interact with Telegram via the Bot API. All operations use
curl against https://api.telegram.org/bot<TOKEN>/....
The environment variable TELEGRAM_BOT_TOKEN must be set to a valid Telegram
Bot API token (obtained from @BotFather). The variable TELEGRAM_CHAT_ID should
be set to the target chat/group/channel ID for sending messages.
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="Hello from shellm" \
-d parse_mode=Markdown
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
-F chat_id="${TELEGRAM_CHAT_ID}" \
-F document=@/path/to/file.txt
Poll for new messages using getUpdates. Use offset to acknowledge
previously seen updates and only receive new ones.
# Get latest updates
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" \
-d limit=10 \
-d timeout=0
# Acknowledge up to update_id 12345 and get only newer updates
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" \
-d offset=12346 \
-d limit=10
Parse the JSON response with jq:
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" \
| jq -r '.result[] | "\(.update_id) \(.message.from.username): \(.message.text)"'
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="Reply text" \
-d reply_to_message_id=MESSAGE_ID
curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getChat" \
-d chat_id="${TELEGRAM_CHAT_ID}" | jq .
All Telegram API responses return JSON with an ok field. Check it:
response=$(curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="test")
if [ "$(echo "$response" | jq -r '.ok')" != "true" ]; then
echo "Telegram API error: $(echo "$response" | jq -r '.description')" >&2
fi
Telegram limits bots to ~30 messages/second to different chats, and ~20 messages/minute to the same chat. Add short delays between batch sends.