Help Center Telegram ボット連携

Telegram ボット連携

このガイドでは、Telegram ボットを chat.smsbat.com パネルに接続する方法を説明します。

1. パネルへのボットの追加

ダッシュボードで マイアカウント -> Telegram ボット に移動します。

  1. ボットを追加 をクリックします。
  2. Telegram ボットのデータ(名前、トークン)を入力し、システムに保存します。
  3. 保存後、ボット設定に移動し、コールバック URL を作成するためにその ID を取得します。

2. Chat.SMSBAT との連携オプション

オプション 2.1: Telegram から Omni Chat へのコールバックのプロキシ

このフローでは、お客様のサーバーが Telegram の Webhook を直接受信し、そのペイロードを SMSBAT に転送します。

sequenceDiagram
    participant Client as Client Server
    participant Tg as Telegram
    participant Proxy as SMSBAT Proxy
    participant Chat as Omni Chat
    actor Operator
    
    Client->>Tg: Send data to bot
    Tg->>Client: Callback from Telegram
    Client->>Proxy: Forward Telegram callback to SMSBAT
    Proxy->>Chat: Reaction to trigger message
    Operator->>Chat: Review and respond
    Chat->>Tg: Interaction with Telegram

要件:

  • クライアントシステムが、受信したコールバックを chat.smsbat.com の Webhook に直接プロキシするようにしてください。
  • 「チャット開始」ボタンの正確なテキスト/アクションを提供してください。
  • 「チャット終了」ボタンの正確なテキスト/アクションを提供してください。

オプション 2.2: クライアントへ戻すプロキシロジック

このフローでは、SMSBAT が Telegram の直接の Webhook として設定されます。SMSBAT がイベントを受信し、そのコールバックをお客様のシステムにプロキシして返します。

sequenceDiagram
    participant Client as Client Server
    participant Tg as Telegram
    participant Proxy as SMSBAT Proxy
    participant Chat as Omni Chat
    actor Operator
    
    Client->>Tg: Send data to bot
    Tg->>Proxy: Callback on events from Telegram
    Proxy->>Client: Forward Telegram callback to Client
    Proxy->>Chat: Reaction to trigger message
    Operator->>Chat: Review and respond
    Chat->>Tg: Operator interaction with Telegram

要件:

  • ボット追加後に作成された、生成済みのコールバック URL を提供してください。URL は次のような形式になります。 https://restapi.smsbat.com/api/tg_callback/{ID}
  • 「チャット開始」ボタンの正確なテキスト/アクションを提供してください。
  • 「チャット終了」ボタンの正確なテキスト/アクションを提供してください。