> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Messaging Channels

> Send messages across multiple platforms with PraisonAI channel tools

<Info>
  PraisonAI supports **7+ messaging channels** including Telegram, Discord, Slack, Signal, LINE, iMessage, and WhatsApp.
</Info>

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonai_tools import SignalTool

agent = Agent(name="Messenger", tools=[SignalTool()])
agent.start("Send a Signal message to +1234567890 saying hello")
```

The user sends a message through a channel; the agent delivers it via the configured messaging tool.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    A[Agent]:::agent --> B[Channel Tool]:::tool
    B --> C[Telegram]:::agent
    B --> D[Discord]:::agent
    B --> E[Signal]:::agent
    B --> F[LINE]:::agent
    B --> G[iMessage]:::agent
    B --> H[WhatsApp]:::agent
    
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Agent
    participant Feature as Messaging Channels

    User->>Agent: Request
    Agent->>Feature: Process request
    Feature-->>Agent: Result
    Agent-->>User: Response
```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonai_tools import SignalTool

    signal = SignalTool()
    signal.send_message(to="+1234567890", message="Hello!")
    ```
  </Step>

  <Step title="With Configuration">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonai_tools import WhatsAppTool

    wa = WhatsAppTool()
    wa.send_message(to="+1234567890", message="Hello!")
    ```
  </Step>
</Steps>

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai-tools
```

***

## Signal

<Card title="Signal Tool" icon="signal-messenger">
  Send messages via Signal using signal-cli REST API.
</Card>

### Setup

<Steps>
  <Step title="Install signal-cli REST API">
    Run the [signal-cli-rest-api](https://github.com/bbernhard/signal-cli-rest-api) Docker container:

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    docker run -d --name signal-api -p 8080:8080 \
      -v signal-cli-config:/home/.local/share/signal-cli \
      bbernhard/signal-cli-rest-api
    ```
  </Step>

  <Step title="Link your device">
    Visit `http://localhost:8080/v1/qrcodelink?device_name=signal-api` to link your Signal account.
  </Step>

  <Step title="Set environment variables">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    export SIGNAL_CLI_URL=http://localhost:8080
    export SIGNAL_ACCOUNT=+1234567890
    ```
  </Step>
</Steps>

### Usage

<CodeGroup>
  ```python Basic theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import SignalTool

  signal = SignalTool()
  result = signal.send_message(
      to="+1234567890",
      message="Hello from PraisonAI!"
  )
  ```

  ```python With Agent theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonaiagents import Agent
  from praisonai_tools import SignalTool

  agent = Agent(
      name="Notifier",
      tools=[SignalTool()]
  )
  agent.start("Send a Signal message to +1234567890 saying hello")
  ```

  ```python Groups theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import SignalTool

  signal = SignalTool()

  # Send to group
  signal.send_message(
      to="group:abc123xyz",
      message="Hello group!"
  )

  # List groups
  groups = signal.list_groups()
  ```
</CodeGroup>

### Actions

| Action          | Description             |
| --------------- | ----------------------- |
| `send`          | Send text message       |
| `send_typing`   | Send typing indicator   |
| `send_receipt`  | Send read receipt       |
| `send_reaction` | React to a message      |
| `check`         | Check connection status |
| `list_groups`   | List all groups         |

***

## LINE

<Card title="LINE Tool" icon="line">
  Send messages via LINE Messaging API.
</Card>

### Setup

<Steps>
  <Step title="Create LINE Channel">
    Go to [LINE Developers Console](https://developers.line.biz/) and create a Messaging API channel.
  </Step>

  <Step title="Get credentials">
    Copy your **Channel access token** and **Channel secret**.
  </Step>

  <Step title="Set environment variables">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    export LINE_CHANNEL_ACCESS_TOKEN=your_token
    export LINE_CHANNEL_SECRET=your_secret
    ```
  </Step>
</Steps>

### Usage

<CodeGroup>
  ```python Push Message theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import LineTool

  line = LineTool()
  result = line.push_message(
      to="user_id",
      message="Hello from PraisonAI!"
  )
  ```

  ```python Broadcast theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import LineTool

  line = LineTool()
  result = line.broadcast(message="Hello everyone!")
  ```

  ```python Flex Message theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import LineTool

  line = LineTool()
  result = line.send_flex_message(
      to="user_id",
      alt_text="New notification",
      contents={
          "type": "bubble",
          "body": {
              "type": "box",
              "layout": "vertical",
              "contents": [
                  {"type": "text", "text": "Hello!"}
              ]
          }
      }
  )
  ```
</CodeGroup>

### Actions

| Action        | Description            |
| ------------- | ---------------------- |
| `push`        | Push message to user   |
| `reply`       | Reply with token       |
| `multicast`   | Send to multiple users |
| `broadcast`   | Send to all followers  |
| `get_profile` | Get user profile       |
| `get_quota`   | Get message quota      |

***

## iMessage

<Card title="iMessage Tool" icon="message">
  Send messages via iMessage on macOS.
</Card>

<Warning>
  iMessage is only available on **macOS**. The tool uses AppleScript to interact with Messages.app.
</Warning>

### Setup

<Steps>
  <Step title="Enable Messages.app">
    Ensure Messages.app is configured with your Apple ID.
  </Step>

  <Step title="Grant permissions">
    Your terminal may need **Accessibility** and **Automation** permissions in System Preferences.
  </Step>
</Steps>

### Usage

<CodeGroup>
  ```python Basic theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import iMessageTool

  imsg = iMessageTool()
  result = imsg.send_message(
      to="+1234567890",
      message="Hello from PraisonAI!"
  )
  ```

  ```python Email Address theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import iMessageTool

  imsg = iMessageTool()
  result = imsg.send_message(
      to="user@example.com",
      message="Hello!"
  )
  ```

  ```python Check Availability theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonai_tools import iMessageTool

  imsg = iMessageTool()
  status = imsg.check_availability()
  print(status)  # {'available': True, 'mode': 'applescript', 'macos': True}
  ```
</CodeGroup>

### Actions

| Action       | Description        |
| ------------ | ------------------ |
| `send`       | Send message       |
| `check`      | Check availability |
| `list_chats` | List recent chats  |

***

## WhatsApp

<Card title="WhatsApp Tool" icon="whatsapp">
  Send messages via WhatsApp Business API.
</Card>

### Setup

<Steps>
  <Step title="Create WhatsApp Business Account">
    Set up a [WhatsApp Business API](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) account.
  </Step>

  <Step title="Get credentials">
    Copy your **Access Token** and **Phone Number ID**.
  </Step>

  <Step title="Set environment variables">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    export WHATSAPP_ACCESS_TOKEN=your_token
    export WHATSAPP_PHONE_NUMBER_ID=your_phone_id
    ```
  </Step>
</Steps>

### Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_tools import WhatsAppTool

wa = WhatsAppTool()
result = wa.send_message(
    to="+1234567890",
    message="Hello from PraisonAI!"
)
```

***

## Using with Agents

All channel tools work seamlessly with PraisonAI agents:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonai_tools import SignalTool, LineTool, TelegramTool

# Create agent with multiple channels
agent = Agent(
    name="MultiChannelBot",
    instructions="Send notifications across multiple platforms",
    tools=[SignalTool(), LineTool(), TelegramTool()]
)

# Agent decides which channel to use
agent.start("Notify John on Signal and the team on LINE about the meeting")
```

***

## Channel Comparison

| Feature           | Signal | LINE | iMessage | WhatsApp | Telegram |
| ----------------- | ------ | ---- | -------- | -------- | -------- |
| **Text**          | ✅      | ✅    | ✅        | ✅        | ✅        |
| **Media**         | ✅      | ✅    | ❌        | ✅        | ✅        |
| **Groups**        | ✅      | ✅    | ✅        | ✅        | ✅        |
| **Reactions**     | ✅      | ❌    | ❌        | ❌        | ✅        |
| **Typing**        | ✅      | ❌    | ❌        | ❌        | ✅        |
| **Read Receipts** | ✅      | ❌    | ❌        | ✅        | ✅        |
| **Broadcast**     | ❌      | ✅    | ❌        | ✅        | ✅        |
| **Platform**      | Any    | Any  | macOS    | Any      | Any      |

***

## Environment Variables

<Accordion title="All Channel Environment Variables">
  | Variable                    | Channel  | Description                 |
  | --------------------------- | -------- | --------------------------- |
  | `SIGNAL_CLI_URL`            | Signal   | signal-cli REST API URL     |
  | `SIGNAL_ACCOUNT`            | Signal   | Your Signal phone number    |
  | `LINE_CHANNEL_ACCESS_TOKEN` | LINE     | LINE channel access token   |
  | `LINE_CHANNEL_SECRET`       | LINE     | LINE channel secret         |
  | `IMESSAGE_API_URL`          | iMessage | REST API URL (optional)     |
  | `IMESSAGE_MODE`             | iMessage | "applescript" or "rest"     |
  | `WHATSAPP_ACCESS_TOKEN`     | WhatsApp | WhatsApp Business API token |
  | `WHATSAPP_PHONE_NUMBER_ID`  | WhatsApp | Phone number ID             |
  | `TELEGRAM_BOT_TOKEN`        | Telegram | Telegram Bot API token      |
  | `DISCORD_BOT_TOKEN`         | Discord  | Discord bot token           |
  | `SLACK_BOT_TOKEN`           | Slack    | Slack bot token             |
</Accordion>

## Best Practices

<AccordionGroup>
  <Accordion title="Use channels for long-running agents">
    Channel-based communication is ideal for agents that need to send progress updates during execution.
  </Accordion>

  <Accordion title="Keep message payloads small">
    Send references (IDs, paths) rather than full data through channels to avoid memory issues.
  </Accordion>

  <Accordion title="Handle channel timeouts">
    Always set a timeout when waiting for channel messages to prevent agents from hanging.
  </Accordion>

  <Accordion title="Use typed messages">
    Define a message format for each channel to make inter-agent communication predictable.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Custom Tools" icon="wrench" href="/docs/tools/custom">
    Build your own agent tools
  </Card>

  <Card title="Tools Overview" icon="toolbox" href="/docs/tools/tools">
    Browse PraisonAI tool documentation
  </Card>
</CardGroup>
