← ClaudeAtlas

telegram-sendlisted

Send a message or file to any Telegram chat from your personal account via Telethon. Use when the user says "send to telegram", "message X", "send this file to the channel".
KogaCyber/jarvis-skills · ★ 0 · AI & Automation · score 68
Install: claude install-skill KogaCyber/jarvis-skills
# Send Telegram Message / File Your JARVIS texts people and posts to channels **as you** — from your personal account via [Telethon](https://docs.telethon.dev), not a bot token. Bots can't DM people who never started them; your account can. ## One-time Setup 1. Get `api_id` and `api_hash` at https://my.telegram.org → API development tools 2. Store them in `~/.jarvis/telegram.env`: ```env TG_API_ID=1234567 TG_API_HASH=your_hash_here TG_SESSION=~/.jarvis/telegram.session ``` 3. First run asks for your phone + login code, then the session file keeps you logged in. **Never commit the session file or the .env — treat both like passwords.** ## Send ```python import os from telethon.sync import TelegramClient api_id = int(os.environ["TG_API_ID"]) api_hash = os.environ["TG_API_HASH"] session = os.path.expanduser(os.environ.get("TG_SESSION", "~/.jarvis/telegram")) with TelegramClient(session, api_id, api_hash) as client: # message client.send_message("@username", "text") # file with caption client.send_file("@username", "/path/to/file.pdf", caption="here you go") # channel/group by ID client.send_message(-1001234567890, "post text") ``` Load the env first: `set -a; source ~/.jarvis/telegram.env; set +a` before running the script. ## Rules - Confirm after sending: "Sent to @username" - On error: retry once, then report the actual error — don't silently fail - Anything outward-facing (channels, clients, strangers) → show the user the draft before send