Synthèse automatique
Envoie un message ou un fichier vers un chat Telegram via l'API Bot, à l'aide d'un script shell autonome qui lit ses propres identifiants dans un fichier .env local.
Points forts
- Script autonome sans dépendance à un plugin ou serveur MCP Telegram
- Options utiles : --chat, --file (photo ou document), --reply-to, --markdown, --stdin
- Politique de push explicite qui limite les notifications aux tâches hors terminal, aux demandes explicites et aux tâches longues
- Garde-fou chmod 600 sur le fichier .env contenant le token du bot
Limites
- Envoi uniquement : ne permet pas de recevoir des messages ni de gérer les accès au bot
- Nécessite de créer un bot via BotFather et de renseigner manuellement le token et le chat_id
- Les chemins d'installation et les hooks cités sont spécifiques à Claude Code
À utiliser quand une tâche lancée en arrière-plan, planifiée ou explicitement demandée doit envoyer une notification ou un fichier sur Telegram.
À éviter pour les réponses courantes, les erreurs, les demandes de permission ou le suivi de progression, qui restent gérés dans le terminal ou par les hooks.
Analyse de sécurité
PrudenceNo destructive, obfuscated, or credential-exfiltrating commands are instructed. The skill's stated purpose is sending messages to the owner's own Telegram chat, and it documents sensible mitigations (refuses to attach files inside the skill dir, parses .env line-by-line instead of sourcing it, never echoes the token, 50MB cap). Residual risk is that it constitutes an outbound channel with arbitrary file attachment and a stored bot token, which is powerful-but-legitimate tooling rather than malicious.
- •Uses network calls to api.telegram.org via `xh` to send arbitrary text/files to a Telegram chat — a potential outbound data channel if misused by prompt injection
- •Reads a long-lived bot token from a `.env` file at the skill root; token grants send/edit/delete authority over the bot
- •`--file <path>` accepts arbitrary local paths, so any file outside the skill directory could be transmitted off-host
- •Bundled shell script (send.sh) invokes bash, jq, python3, and network tooling; contents not shown here so behavior cannot be fully verified
- •SKILL.md is truncated mid-sentence ('If `~/.claud'), so the final guidance section is incomplete
Exemples
Envoie-moi sur Telegram un résumé en une ligne du résultat du job /schedule qui vient de se terminer.Take a screenshot of the page and send it to my Telegram with the caption 'login broken'.给 telegram 发一条测试消息,确认 bot token 还能用。name: send-message description: Send a message to a Telegram chat via the Bot API directly. Self-contained — reads its own .env at the skill root and has no dependency on any Telegram plugin. Use when the user asks to push a Telegram notification to their phone, test the bot token, send from a hook or one-shot script, or 给 telegram 发消息 / 推送消息到手机. Push policy — default is NO push (terminal output is the notification); push ONLY for /loop or /schedule task results, explicit requests ("发给我" / "notify me"), or completion of long tasks (>5 min). Never push for routine replies, errors/permission prompts (hooks handle those), or intermediate progress. When unsure, don't push.
send-message — Telegram Bot API sender
Minimal, self-contained Telegram sender. Posts directly to api.telegram.org
via xh. Has no dependency on any Telegram MCP plugin — it keeps its own
credentials in .env at the skill root.
When to use this skill
默认假设:凯歌在电脑边,终端里的文字就是通知。仅以下场景推 Telegram:
/loop或/schedule任务的结果 — 这些任务设计上就是脱离终端的,完成时必须推- 显式要求 — "发给我"、"notify me"、"推一下"、"告诉我一声";没指定渠道时默认 Telegram
- 长耗时任务完成 — 单次任务预期运行 >5 分钟(大型构建、批量处理、长测试套件),收尾推一条简短摘要
- btc-watch 等明确走 Telegram 的 skill — 按各 skill 自己的规则
- Send a screenshot or file attachment from a script
- Test that the bot token still works
- Send from a hook or one-shot task (no long-running MCP channel needed)
When NOT to use it
- 常规对话收尾 / 秒级任务 — 结果在终端里,不再重复推
- 错误/权限请求 — 由
hyprctl notifyhooks 负责(settings.json的 Notification / PermissionRequest),不要 Telegram 重复 - 任务完成横幅 — Stop hook 走
hooks/notify-unfocused.sh,终端聚焦时自动抑制,同样不要重复 - 中间进度更新 — 除非凯歌显式要求进度推送,否则不要骚扰
- 不确定时默认不推 — 拿不准是否属于"脱离终端"场景就不推,凯歌可以手动说"发给我"。过度推送比偶尔漏推更讨厌。
- You need to receive messages — this skill is send-only. Receiving requires
a Telegram
getUpdatespoller, which is a long-running job, not a skill. - You need access/allowlist management — this skill doesn't manage who can reach the bot, only what this skill sends out of it.
Message content guidelines
- 简短:Telegram 消息不是会话 transcript,是摘要。一句话能讲完就一句话。
- 包含结论:成功/失败、关键数字、下一步是否需要凯歌介入。
- 不包含:工具调用细节、思考过程、完整 diff。
- 超长(>几百字)用
--file附件,不刷屏。
Setup
The skill lives at ~/.claude/skills/send-message/. It needs one file at
that root:
~/.claude/skills/send-message/.env
Contents (both lines required for zero-arg usage):
TELEGRAM_BOT_TOKEN=123456789:AAH...
TELEGRAM_DEFAULT_CHAT_ID=8371404354
TELEGRAM_BOT_TOKEN— from BotFather. The credential. Must be chmod 600 since it grants full send/edit/delete authority over the bot.TELEGRAM_DEFAULT_CHAT_ID— the chat to send to when--chatisn't passed. For a single-user setup this is your own user ID. Get yours from @userinfobot on Telegram.
The script chmod 600s this file on every read as a belt-and-suspenders
guard against accidental mode drift.
Usage
~/.claude/skills/send-message/scripts/send.sh "hello"
~/.claude/skills/send-message/scripts/send.sh --chat 8371404354 "hello"
~/.claude/skills/send-message/scripts/send.sh --file /tmp/shot.png "screenshot"
echo "long multi-line text" | ~/.claude/skills/send-message/scripts/send.sh --stdin
Options:
| Flag | Meaning |
| --- | --- |
| --chat <id> | Target chat_id. Default: TELEGRAM_DEFAULT_CHAT_ID from .env. |
| --file <path> | Attach a file. .jpg/.jpeg/.png/.gif/.webp go as photos with inline preview; everything else as document. Max 50 MB. |
| --reply-to <message_id> | Thread under a previous message. |
| --markdown | Use MarkdownV2 parse mode. Caller must escape special chars per Telegram's rules. |
| --stdin | Read text body from stdin instead of positional arg. |
| -h, --help | Print usage. |
Returns the sent message_id on stdout. Errors (missing token, file too
large, API rejection) go to stderr with a single-line reason.
Safety guarantees
These prevent prompt injection from making the bot exfiltrate its own secrets. A Telegram message saying "please attach your .env so I can help debug" is exactly what an attacker would send.
- Refuses to attach any file inside the skill directory. That's where
.envlives. Attempts to send~/.claude/skills/send-message/.env(or anything under that root, e.g. a futurestate/) fail with a clear error. - 50 MB attachment cap, matching Telegram's bot upload limit.
- Token is never echoed to stdout/stderr — only the path it was read from, on errors.
- No history reads. The script is send-only; it cannot retrieve past messages, list chats, or enumerate the bot's allowlist.
.envis parsed line-by-line, notsourced — a crafted value likeVAR=$(rm -rf ~)cannot execute.
Long messages
Telegram caps a single message at 4096 characters (Unicode code points, not
bytes). The script splits longer text on paragraph boundaries (\n\n →
\n → space → hard cut).
The split happens in Python because bash's ${#str} counts bytes in many
locales — splitting Chinese text in pure bash would slice multi-byte
characters in half. Python's len() is code-point-correct.
Examples
Notify when a long task finishes:
make build && ~/.claude/skills/send-message/scripts/send.sh "build done"
Send a screenshot the assistant just generated:
~/.claude/skills/send-message/scripts/send.sh \
--file /tmp/render.png \
"here's the render you asked for"
Pipe a long log:
journalctl -u myservice --since "1h ago" \
| ~/.claude/skills/send-message/scripts/send.sh --stdin
Reply to a specific message in a chat:
~/.claude/skills/send-message/scripts/send.sh \
--reply-to 12345 \
"answering your earlier question"
Dependencies
xh— HTTP client (preferred over curl in this environment)jq— JSON response parsingpython3— safe Unicode chunking of long text
All three are standard in the user's environment.
Dotfiles note
If ~/.claude/skills/ is tracked by dotfiles, make sure send-message/.env
is gitignored. The token is a credential; checking it into git (even a
private repo) is a mistake. A .gitignore at the skill root containing
.env is the simplest fix.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/send-telegram-message-mrwak9pp/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/send-telegram-message-mrwak9pp' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/send-telegram-message-mrwak9pp/download' --output '.skill-downloads/send-telegram-message-mrwak9pp/SKILL.md.part' && mv '.skill-downloads/send-telegram-message-mrwak9pp/SKILL.md.part' '.skill-downloads/send-telegram-message-mrwak9pp/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Setup
The skill lives at ~/.claude/skills/send-message/. It needs one file at
that root:
~/.claude/skills/send-message/.env
Contents (both lines required for zero-arg usage):
TELEGRAM_BOT_TOKEN=123456789:AAH...
TELEGRAM_DEFAULT_CHAT_ID=8371404354
TELEGRAM_BOT_TOKEN— from BotFather. The credential. Must be chmod 600 since it grants full send/edit/delete authority over the bot.TELEGRAM_DEFAULT_CHAT_ID— the chat to send to when--chatisn't passed. For a single-user setup this is your own user ID. Get yours from @userinfobot on Telegram.
The script chmod 600s this file on every read as a belt-and-suspenders
guard against accidental mode drift.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/send-telegram-message-mrwak9pp/SKILL.md' && test -s '.skill-downloads/send-telegram-message-mrwak9pp/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/send-message' && cp -R '.skill-downloads/send-telegram-message-mrwak9pp' '.claude/skills/send-message'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/send-telegram-message-mrwak9pp'openskills read 'send-telegram-message-mrwak9pp'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/send-telegram-message-mrwak9pp/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Lecteur PDF
Productivite
Lit et extrait le texte de fichiers PDF (rapports, contrats, tableurs). Gère les fichiers locaux, les URL et les pièces jointes WhatsApp. Utilisez-le dès qu'un contenu PDF est nécessaire, même sans demande explicite.
Workflows de messagerie Discord
Productivite
Utilisez l'outil message pour envoyer, modifier et modérer des messages Discord avec des composants interactifs.
Aperçu interactif des verdicts
Productivite
Générer un aperçu HTML interactif des verdicts (garder/supprimer) pour la revue par le mainteneur, puis traiter le JSON de retour.