Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

telegram

БесплатноЗапускает вложенные скриптыНе проверен

Full personal Telegram control over MTProto (Telethon) with the user's own account — list/search chats, read & summarize history, see unread, look up contacts…

AceDataCloudот AceDataCloud★ 17 звёзд на GitHub

Об этом скилле

We drive personal Telegram over MTProto with Telethon — this acts as the user's own account (a "userbot"), so unlike the Bot API it can read full history, list every conversation, and act on anyone the user can reach.

Credentials are injected as env vars by the connector:

  • TELEGRAM_API_ID — app id
  • TELEGRAM_API_HASH — app hash — secret, never echo
  • TELEGRAM_SESSION_STRING — Telethon StringSession = full account access. Never log, echo, or print it. Treat it like the account password.

CLI

The skill ships scripts/tg.py — self-contained (the only third-party dep is telethon, preinstalled in the sandbox). Point a var at the shipped path and call it; no heredoc to re-create per turn, so a multi-step flow (dry-run → confirm) can't lose the helper between calls:

# $SKILL_DIR can point at another skill loaded this turn — anchor on our own
# script (re-run this at the top of every fresh-shell Bash block below).
TG="$SKILL_DIR/scripts/tg.py"; [ -f "$TG" ] || TG=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/tg.py' 2>/dev/null | head -1)
[ -f "$TG" ] || { echo "telegram script not found (SKILL_DIR=$SKILL_DIR)" >&2; exit 1; }
python3 "$TG" whoami

Every state-changing command (send, reply, send-file, forward, edit, delete, react, mark-read, join, leave) is gated: without a trailing --confirm it only DRY-RUNS (prints what it would do, changes nothing). Read commands run directly. --confirm is honored only as the last argument so a message/caption that merely contains "--confirm" can never silently confirm.

Verify the connection first

python3 "$TG" whoami
# → {"id": 100000000, "username": "<the connected handle>", "name": "<display name>", "phone": "..."}

On an auth/session error the stored session is dead — tell the user to reconnect at https://studio.acedata.cloud/console/connectors.

Read recipes

Goal Command
Recent conversations python3 "$TG" list-chats 20
Only chats with unread (ranked) python3 "$TG" unread
A chat's history (oldest→newest) python3 "$TG" get-messages <target> 50
Search inside one chat python3 "$TG" search <target> "kw" 30
Search across ALL chats python3 "$TG" search-global "kw" 30
List contacts python3 "$TG" contacts
Info about a chat/user python3 "$TG" chat-info <target>
List a forum group's topics (threads) python3 "$TG" list-topics <target>
t.me link to a message python3 "$TG" message-link <target> <msg_id>

<target> = numeric id (most reliable — from list-chats), @username, phone, or exact chat name. In message rows, out:true = sent by the user; media:true = has an attachment.

Summarize-unread pattern: unread → pick the chats that matter → get-messages <id> N on each → summarize. Don't dump 20k messages; sample the most-unread / most-relevant.

Media

# Download an attachment from a message → returns the saved path
python3 "$TG" download-media <target> <msg_id> ./tg_downloads
# Send a local file OR an http(s) URL (optional caption) — GATED
python3 "$TG" send-file <target> /path/or/https-url "caption" --confirm

An http(s) URL is downloaded to a real local file first (with the right extension from the URL / Content-Type) and then uploaded, so a remote image lands as a photo — not a document, and not a silent failure. This is the reliable way to "发图": pass the CDN URL straight to send-file.

To hand a downloaded file back to the user as a link, upload it to the CDN (see the cos-upload skill) after download-media.

Write recipes — all GATED (dry-run unless trailing --confirm)

Sending/editing/deleting acts as the real user. Always run the dry run first, show the user exactly what will happen, get an explicit "yes", then re-run with --confirm as the last argument. Never bulk-send.

python3 "$TG" send    <target> "text"                          # → dry_run; add --confirm to send
python3 "$TG" send    <target> "text" --topic <top_message> --confirm  # into a forum topic thread
python3 "$TG" reply   <target> <msg_id> "text" --confirm
python3 "$TG" forward <from_target> <msg_id> <to_target> --confirm
python3 "$TG" edit    <target> <msg_id> "new text" --confirm   # own messages
python3 "$TG" delete  <target> <msg_id> --confirm              # destructive
python3 "$TG" react   <target> <msg_id> "👍" --confirm
python3 "$TG" mark-read <target> --confirm                     # sends read receipts
python3 "$TG" join    <@username|t.me/link|t.me/+invite> --confirm  # join a public group/channel or a private invite
python3 "$TG" leave   <target> --confirm                       # leave a group/channel (not private chats)

join accepts a public @username / t.me/<name> (→ JoinChannelRequest) or a private invite link t.me/+HASH / t.me/joinchat/HASH (→ ImportChatInviteRequest). Joining someone else's group

Полный SKILL.md на GitHub

Установить telegram в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/tg.py

FAQ

Что делает скилл telegram?

Full personal Telegram control over MTProto (Telethon) with the user's own account — list/search chats, read & summarize history, see unread, look up contacts & chat info, list a forum group's topics, download media, and send / reply / forward / edit / delete / react / send files / mark read / join & leave groups, including posting into a forum topic thread. Use when the user mentions Telegram, a Telegram chat/group/contact, "我的 Telegram", reading/replying/forwarding/summarizing Telegram messages, their unread Telegram, joining or leaving a Telegram group/channel, posting into a forum group's topic, or sending a file/message on Telegram.

Как установить скилл telegram?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл telegram запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить telegram с