Telegram Botのロゴ

Telegram Bot

コミュニティ
whatnickcodes
telegram-bot

Telegram bot integration for receiving messages and reactions. Use when setting up Telegram webhooks or managing Telegram bot configuration.

概要

公開者whatnickcodes
リポジトリclappie
スキル名telegram-bot
スター
27
フォーク
6
同梱ファイル
7
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 7個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    whatnickcodesがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルTelegram BotをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/whatnickcodes/clappie/tree/main/.claude/skills/telegram-bot
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/whatnickcodes/clappie.git /tmp/clappie
mkdir -p .claude/skills
cp -r /tmp/clappie/.claude/skills/telegram-bot .claude/skills/telegram-bot
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでTelegram Botを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にTelegram Botを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Telegram Botは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Telegram Bot Skill

Telegram bot integration for receiving messages/reactions and spawning sidekicks.

Setup

1. Create Bot with BotFather

  1. Open Telegram, search for @BotFather
  2. Send /newbot and follow prompts
  3. Copy the bot token (looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)

2. Get Your User ID

  1. Search for @userinfobot in Telegram
  2. Send any message - it replies with your user ID (a number like YOUR_USER_ID)

3. Add to .env

bash
TELEGRAM_BOT_TOKEN=your-bot-token-from-botfather
TELEGRAM_WEBHOOK_SECRET=any-random-secret-string-you-make-up

The TELEGRAM_WEBHOOK_SECRET can be anything - it's used to verify webhooks are from Telegram.

4. Configure Settings

bash
# Enable the bot
echo "true" > recall/settings/telegram-bot/enabled.txt

# Allow your Telegram user ID
echo "YOUR_USER_ID" > recall/settings/telegram-bot/users.txt

# Enable incoming messages
mkdir -p recall/settings/telegram-bot/webhooks
echo "true" > recall/settings/telegram-bot/webhooks/incoming-message.txt

5. Start Sidekick Server

bash
clappie background start sidekicks

6. Expose via Tailscale Funnel

Telegram only allows ports 80, 88, 443, or 8443. Use Tailscale Funnel to proxy:

bash
# Expose port 7777 on HTTPS (Tailscale handles certs)
tailscale funnel 7777

This gives you a URL like https://your-machine.tail1234.ts.net

7. Set Webhook URL

Get your webhook path and set the webhook:

bash
# Get the webhook path
WEBHOOK_PATH=$(cat recall/settings/telegram-bot/webhook-path.txt)

# Set webhook with Telegram (IMPORTANT: include secret_token!)
curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook" \
  -d "url=https://your-machine.tail1234.ts.net/webhooks/telegram-bot/${WEBHOOK_PATH}" \
  -d "secret_token=${TELEGRAM_WEBHOOK_SECRET}"

Critical: The secret_token parameter must match your TELEGRAM_WEBHOOK_SECRET env var, or signature verification will fail.

8. Verify Webhook

bash
curl "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getWebhookInfo"

Should show your URL with pending_update_count: 0 and no errors.

Settings

All settings in recall/settings/telegram-bot/:

FileDescriptionRequired
enabled.txtSet to true to enableYes
webhook-path.txtSecret URL segment (auto-generated)Auto
users.txtAllowed Telegram user IDs (one per line)Yes
webhooks/incoming-message.txtEnable incoming messagesYes
sidekick-prompt.txtCustom prompt/personality for sidekicks (overrides skill defaults)No

CLI Commands

bash
clappie telegram send <chatId> <message>      # Send text message
clappie telegram photo <chatId> <path>        # Send photo
clappie telegram document <chatId> <path>     # Send document
clappie telegram voice <chatId> <path>        # Send voice message
clappie telegram video <chatId> <path>        # Send video
clappie telegram sticker <chatId> <id>        # Send sticker
clappie telegram react <chatId> <msgId> <emoji>  # React to message
clappie telegram webhook <url>                # Set webhook URL
clappie telegram webhook-info                 # Get webhook status
clappie telegram me                           # Get bot info

Sidekick Extension Commands

When a Telegram sidekick is running, these extra commands are available (registered via sidekickCommands in webhooks/send.js). The sidekick ID is auto-detected from the CLAPPIE_SIDEKICK_ID env var -- no need to type it. Explicit ID still works as an override.

bash
clappie sidekick react <msgId> 👍                  # React to a message
clappie sidekick combo <msgId> 👍 🔥 🎉            # Sequential reaction combo
clappie sidekick sticker <setName> [index]          # Send sticker from set
clappie sidekick sticker <setName> random            # Random sticker from set
clappie sidekick send-file photo "/path" "caption"
clappie sidekick send-file document "/path" "caption"
clappie sidekick send-file voice "/path"
clappie sidekick send-file video "/path" "caption"

These are only available to sidekicks with source: telegram-bot. Internal sidekicks or Slack sidekicks can't use them.

Reactions

When a user reacts to a message, the sidekick receives:

[Reacted with 👍]

Direct CLI (not sidekick):

bash
clappie telegram react YOUR_USER_ID 123 👍

How It Works

  1. User sends message to bot
  2. Telegram POSTs to /webhooks/telegram-bot/{webhook-path}
  3. Server verifies X-Telegram-Bot-Api-Secret-Token header matches TELEGRAM_WEBHOOK_SECRET
  4. Handler parses message, downloads any attachments
  5. Sidekick spawns with message content
  6. Claude can reply via clappie sidekick send, clappie sidekick react, etc.

Troubleshooting

"Invalid signature" errors When setting webhook, you MUST include secret_token:

bash
curl -X POST "https://api.telegram.org/bot.../setWebhook" \
  -d "url=https://..." \
  -d "secret_token=${TELEGRAM_WEBHOOK_SECRET}"

"Bad port" error from Telegram Telegram only allows ports 80, 88, 443, 8443. Use Tailscale Funnel or another reverse proxy.

"Not found" when visiting webhook URL in browser Normal - webhooks only accept POST requests.

Messages not received

  • Is Tailscale Funnel running?
  • Is sidekick server running? (clappie background start sidekicks)
  • Is user ID in users.txt?
  • Check getWebhookInfo for errors

Bot doesn't respond

  • Check sidekick logs: tail -f recall/logs/sidekicks/*.txt
  • Make sure enabled.txt is true

Environment Variables

VariableDescription
TELEGRAM_BOT_TOKENBot token from BotFather
TELEGRAM_WEBHOOK_SECRETSecret for webhook verification (you make this up)

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Telegram Bot」では何ができますか?

Telegram bot integration for receiving messages and reactions. Use when setting up Telegram webhooks or managing Telegram bot configuration.

TypingMindでTelegram Botを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Telegram Botはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにTelegram Botをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/whatnickcodes/clappie/tree/main/.claude/skills/telegram-botを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Telegram Botを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Telegram Botは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもTelegram Botを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Telegram Bot」は無料ですか?

whatnickcodesがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇