본문으로 건너뛰기
TakoAPI
스킬로 돌아가기

telegram-history

rhlsthrm 제작

Browser & Automation
1.2kclawskills.sh가 보고한 다운로드 수
1스타
0조회수
좋아요 0개로그인하면 이 스킬에 좋아요를 누를 수 있습니다
—아직 평가 없음
내 평가

요약

Fetch Telegram chat message history via MTProto user API (Telethon)

설명

이 스킬이 하는 일

Fetches message history from Telegram chats, groups, and forum topics using the MTProto user API via Telethon. The Telegram Bot API cannot read chat history, so this skill authenticates as a user account instead. Supports filtering by topic, pagination by message ID, and JSON output.

Unlike the Bot API, MTProto user authentication gives read access to any chat the account belongs to, including history the bot endpoint blocks entirely.

사용 시점

  • Archiving old messages from a private Telegram group
  • Exporting a forum topic thread before it gets deleted
  • Paginating through thousands of messages in a large channel
  • Pulling chat logs into a local database for search
  • Reviewing message history in a group the bot API cannot access

예시 워크플로

입력

User asks: Fetch the last 50 messages from group -1001234567890 as JSON

에이전트
  1. 1

    Load api_id and api_hash from api_credentials.json in the skill directory

  2. 2

    Resume the saved Telethon session for the authenticated user account

  3. 3

    Call tg_history.py with the chat ID, --limit 50, and --json flags

  4. 4

    Resolve sender display names for each message

  5. 5

    Return the formatted JSON array

출력

A JSON array of 50 messages with sender names, timestamps, and message text

요구 사항

  • Telegram API credentials (api_id and api_hash) from https://my.telegram.org/apps
  • Telegram account phone number for one-time login

설치

clawhub install rhlsthrm/telegram-history

CLI 명령을 실행하거나, 프롬프트를 Claude Code, Cursor, Codex 등 사용하는 코딩 에이전트에 붙여넣으세요.

링크