---
name: telegram-sender
description: Send messages, files, images, logs, links, summaries, status updates, and artifacts to the user through Telegram using a configured Telegram bot. Use when the user asks to send something on Telegram, Telegram them a result, notify them, DM them, or deliver a file/status outside the Codex chat.
---


# Telegram Sender

Use the bundled script for Telegram delivery:

```bash
python3 /Users/tec/.codex/skills/telegram-sender/scripts/send_telegram.py --message "done"
python3 /Users/tec/.codex/skills/telegram-sender/scripts/send_telegram.py --file /absolute/path/to/file --caption "artifact"
```

## Configuration

Token lookup order:

1. `TELEGRAM_BOT_TOKEN`
2. macOS Keychain service `codex-telegram-bot-token`

Chat lookup order:

1. `TELEGRAM_CHAT_ID`
2. macOS Keychain service `codex-telegram-chat-id`
3. `--discover-chat` after the user has sent any message to the bot

Save values to Keychain:

```bash
security add-generic-password -a "$USER" -s codex-telegram-bot-token -w "$TELEGRAM_BOT_TOKEN" -U
security add-generic-password -a "$USER" -s codex-telegram-chat-id -w "$TELEGRAM_CHAT_ID" -U
```

## Workflow

1. For short text, use `--message`.
2. For longer command output, pipe stdin:

```bash
some-command | python3 /Users/tec/.codex/skills/telegram-sender/scripts/send_telegram.py --message -
```

3. For artifacts, use `--file /absolute/path` and include a concise `--caption`.
4. If sending screenshots or generated images, add `--photo` so Telegram renders them inline.
5. If chat id is missing, ask the user to message the bot once, then run:

```bash
python3 /Users/tec/.codex/skills/telegram-sender/scripts/send_telegram.py --discover-chat --save-discovered-chat
```

## Safety

- Never print, paste, or include the bot token in user-facing output.
- Do not send credentials, private keys, cookies, or sensitive logs unless the user explicitly requests that exact send.
- When a file may contain secrets, inspect or summarize it first and ask before sending.
- Prefer concise notifications over dumping huge logs into Telegram.
