> ## 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

> [!NOTE]
>
> PraisonAI supports **7+ messaging channels** including Telegram, Discord, Slack, Signal, LINE, iMessage, and WhatsApp.

```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

**1. 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!")
```

**2. 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!")
```

## Installation

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

***

## Signal

> [card] Signal Tool
>
> Send messages via Signal using signal-cli REST API.

### Setup

**1. 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
```

**2. Link your device**

Visit `http://localhost:8080/v1/qrcodelink?device_name=signal-api` to link your Signal account.

**3. Set environment variables**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export SIGNAL_CLI_URL=http://localhost:8080
export SIGNAL_ACCOUNT=+1234567890
```

### Usage

```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()
```

### 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] LINE Tool
>
> Send messages via LINE Messaging API.

### Setup

**1. Create LINE Channel**

Go to [LINE Developers Console](https://developers.line.biz/) and create a Messaging API channel.

**2. Get credentials**

Copy your **Channel access token** and **Channel secret**.

**3. 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
```

### Usage

```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!"}
            ]
        }
    }
)
```

### 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] iMessage Tool
>
> Send messages via iMessage on macOS.

> [!WARNING]
>
> iMessage is only available on **macOS**. The tool uses AppleScript to interact with Messages.app.

### Setup

**1. Enable Messages.app**

Ensure Messages.app is configured with your Apple ID.

**2. Grant permissions**

Your terminal may need **Accessibility** and **Automation** permissions in System Preferences.

### Usage

```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}
```

### Actions

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

***

## WhatsApp

> [card] WhatsApp Tool
>
> Send messages via WhatsApp Business API.

### Setup

**1. Create WhatsApp Business Account**

Set up a [WhatsApp Business API](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) account.

**2. Get credentials**

Copy your **Access Token** and **Phone Number ID**.

**3. 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
```

### 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] 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 |

## Best Practices

> [accordion] Use channels for long-running agents
>
> Channel-based communication is ideal for agents that need to send progress updates during execution.

> [accordion] Keep message payloads small
>
> Send references (IDs, paths) rather than full data through channels to avoid memory issues.

> [accordion] Handle channel timeouts
>
> Always set a timeout when waiting for channel messages to prevent agents from hanging.

> [accordion] Use typed messages
>
> Define a message format for each channel to make inter-agent communication predictable.

## Related

> [card] [Custom Tools](https://praison.ai/docs/tools/custom.md)
>
> Build your own agent tools

> [card] [Tools Overview](https://praison.ai/docs/tools/tools.md)
>
> Browse PraisonAI tool documentation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.