agent-telegram
TelegramのTDLibを通じて認証を行い、チャットの内容を確認したりメッセージを送信したりするなど、Telegramをより便利に活用するための連携を可能にするSkill。
📜 元の英語説明(参考)
Interact with Telegram through TDLib - authenticate, inspect chats, and send messages
🇯🇵 日本人クリエイター向け解説
TelegramのTDLibを通じて認証を行い、チャットの内容を確認したりメッセージを送信したりするなど、Telegramをより便利に活用するための連携を可能にするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o agent-telegram.zip https://jpskill.com/download/10069.zip && unzip -o agent-telegram.zip && rm agent-telegram.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10069.zip -OutFile "$d\agent-telegram.zip"; Expand-Archive "$d\agent-telegram.zip" -DestinationPath $d -Force; ri "$d\agent-telegram.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
agent-telegram.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
agent-telegramフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Agent Telegram
AIエージェント向けの、TDLibをバックエンドとするTelegram CLIです。このCLIは、my.telegram.org経由でAPI認証情報を自動的にプロビジョニングします。ユーザーはapi_id/api_hashを知ったり、提供したりする必要は一切ありません。
以下のいずれかのエントリポイントを使用してください。
- グローバルインストール:
agent-telegram ... - 1回限りの実行:
bunx --package agent-messenger agent-telegram ...
クイックスタート
# ログイン (CLIがAPI認証情報を自動的にプロビジョニングします)
agent-telegram auth login --phone +821012345678
# チャット一覧を表示
agent-telegram chat list
# メッセージを送信
agent-telegram message send <chat-id-or-@username> "Hello from agent-telegram"
認証フロー
Telegramの認証はステートフルです。TDLibは認証状態をローカルに保持するため、各呼び出しは前回の状態から継続されます。カスタムの状態管理は不要です。CLIはログイン時にmy.telegram.org経由でAPI認証情報を自動的にプロビジョニングするため、手動での認証情報設定は不要です。
エージェントの動作 (必須)
アカウントが設定されていないためにコマンドが失敗した場合、エージェントは認証フローを自身で進める必要があります。ユーザーにコマンドを実行するように指示しないでください。エージェントがすべてを実行します。api_id、api_hash、またはmy.telegram.orgについてユーザーに言及しないでください。これらはCLIによって処理される内部的な詳細です。
ステップ 1: 既存のアカウントの確認
agent-telegram auth list
アカウントが存在する場合 → agent-telegram auth use <account-id> を実行し、元のコマンドを再試行します。
ステップ 2: アカウントがない場合、電話番号を尋ねる
ユーザーにTelegramの電話番号を尋ねます(国際形式、例:+821012345678)。これがログインを開始するためにユーザーが提供する必要がある唯一の情報です。
ステップ 3: ログインを開始 — CLIがAPI認証情報を自動的にプロビジョニングします
agent-telegram auth login --phone <phone>
# → {"next_action":"provide_provisioning_code","message":"A code was sent to your Telegram app. Provide it via --provisioning-code."}
CLIは、認証情報プロビジョニングのために、ユーザーのTelegramアプリに認証コードを送信します。これはTDLibのログインコードではありません。API認証情報を自動的に取得するためのものです。
ステップ 4: ユーザーにプロビジョニングコードを尋ね、提供する
agent-telegram auth login --phone <phone> --provisioning-code <code>
# → {"next_action":"provide_code","message":"Enter the code sent to your Telegram app via --code."}
プロビジョニングが成功すると、CLIはTDLibログインに進み、実際の認証のために別のコードをユーザーのTelegramアプリに送信します。
ステップ 5: ユーザーにTDLibログインコードを尋ね、提供する
agent-telegram auth login --code <code>
# → {"authenticated":true,...}
# または2FAが有効な場合:
# → {"next_action":"provide_password","message":"2FA password required via --password."}
ステップ 6: 2FAが必要な場合、ユーザーにパスワードを尋ね、提供する
agent-telegram auth login --password <password>
ステップ 7: 元のコマンドを再試行する
認証が成功したら、ユーザーが最初に要求したものをすぐに実行します。
重要: 2つの異なるコード
ログインフローでは、ユーザーから2つのコードが必要になる場合があります。
- プロビジョニングコード (
--provisioning-code経由) — my.telegram.orgからAPI認証情報を自動的に取得するため - TDLibログインコード (
--code経由) — Telegramアカウント認証のため
ユーザーにコードを尋ねる場合は、どちらが必要かを明確にしてください。両方の場合に「Telegramアプリに送信されたコードが必要です」と伝えてください。ユーザーはそれらをTelegramの認証コードとして認識します。
一般的な認証コマンド
agent-telegram auth status # 現在の状態を確認
agent-telegram auth list # 保存されているアカウントを一覧表示
agent-telegram auth use <id> # アカウントを切り替え
agent-telegram auth logout # ログアウト
一般的なコマンド
# 現在認証されているユーザーを表示
agent-telegram whoami
agent-telegram whoami --pretty
agent-telegram whoami --account <account-id>
# タイトルまたはユーザー名でチャットを検索
agent-telegram chat search "project"
# チャットのメタデータを取得
agent-telegram chat get @durov
# 最近のメッセージを一覧表示
agent-telegram message list @durov --limit 10
# ログアウト
agent-telegram auth logout
注記
- Telegramの電話番号は、国際形式である必要があります。例:
+14155551234。 - TDLibは、ローカルのアカウント状態を
~/.config/agent-messenger/telegram/に保持します。 agent-telegramはデフォルトでJSONを返し、--prettyはインデントされた出力を返します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Agent Telegram
A TDLib-backed Telegram CLI for AI agents. The CLI auto-provisions API credentials via my.telegram.org — users never need to know or provide api_id/api_hash.
Use one of these entrypoints:
- Global install:
agent-telegram ... - One-off execution:
bunx --package agent-messenger agent-telegram ...
Quick Start
# Login (CLI auto-provisions API credentials)
agent-telegram auth login --phone +821012345678
# List chats
agent-telegram chat list
# Send a message
agent-telegram message send <chat-id-or-@username> "Hello from agent-telegram"
Authentication Flow
Telegram auth is stateful. TDLib persists authorization state locally, so each call picks up where the last one left off — no custom state management needed. The CLI automatically provisions API credentials via my.telegram.org during login — no manual credential setup required.
Agent Behavior (MANDATORY)
When a command fails because no account is configured, the agent MUST drive the auth flow itself. Never tell the user to run commands — the agent runs everything. Never mention api_id, api_hash, or my.telegram.org to the user — these are internal details handled by the CLI.
Step 1: Check for existing accounts
agent-telegram auth list
If accounts exist → agent-telegram auth use <account-id> and retry the original command.
Step 2: If no accounts, ask for phone number
Ask the user for their Telegram phone number (international format, e.g. +821012345678). This is the ONLY thing the user needs to provide to start login.
Step 3: Start login — CLI auto-provisions API credentials
agent-telegram auth login --phone <phone>
# → {"next_action":"provide_provisioning_code","message":"A code was sent to your Telegram app. Provide it via --provisioning-code."}
The CLI sends a verification code to the user's Telegram app for credential provisioning. This is NOT the TDLib login code — it's for obtaining API credentials automatically.
Step 4: Ask user for the provisioning code, then provide it
agent-telegram auth login --phone <phone> --provisioning-code <code>
# → {"next_action":"provide_code","message":"Enter the code sent to your Telegram app via --code."}
After provisioning succeeds, the CLI continues to TDLib login and sends ANOTHER code to the user's Telegram app for actual authentication.
Step 5: Ask user for the TDLib login code, then provide it
agent-telegram auth login --code <code>
# → {"authenticated":true,...}
# or if 2FA enabled:
# → {"next_action":"provide_password","message":"2FA password required via --password."}
Step 6: If 2FA required, ask user for password, then provide it
agent-telegram auth login --password <password>
Step 7: Retry the original command
After successful auth, immediately execute whatever the user originally asked for.
IMPORTANT: Two separate codes
The login flow may require TWO codes from the user:
- Provisioning code (via
--provisioning-code) — for auto-obtaining API credentials from my.telegram.org - TDLib login code (via
--code) — for Telegram account authentication
When asking the user for codes, be clear about which one you need. Say "I need the code sent to your Telegram app" for both — the user sees them as Telegram verification codes.
Common Auth Commands
agent-telegram auth status # Check current state
agent-telegram auth list # List stored accounts
agent-telegram auth use <id> # Switch accounts
agent-telegram auth logout # Logout
Common Commands
# Show current authenticated user
agent-telegram whoami
agent-telegram whoami --pretty
agent-telegram whoami --account <account-id>
# Search chats by title or username
agent-telegram chat search "project"
# Get chat metadata
agent-telegram chat get @durov
# List recent messages
agent-telegram message list @durov --limit 10
# Logout
agent-telegram auth logout
Notes
- Telegram phone numbers must be in international format, for example
+14155551234. - TDLib persists local account state under
~/.config/agent-messenger/telegram/. agent-telegramreturns JSON by default and--prettyfor indented output.