Messaging Channels

Send messages across multiple platforms with PraisonAI channel tools

python
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.

Diagram

Agent

Channel Tool

Telegram

Discord

Signal

LINE

iMessage

WhatsApp

Diagram
Messaging ChannelsAgentUserMessaging ChannelsAgentUserRequestProcess requestResultResponse

Quick Start

  1. Simple Usage
    python
    from praisonai_tools import SignalTool
    
    signal = SignalTool()
    signal.send_message(to="+1234567890", message="Hello!")
  2. With Configuration
    python
    from praisonai_tools import WhatsAppTool
    
    wa = WhatsAppTool()
    wa.send_message(to="+1234567890", message="Hello!")

Installation

bash
pip install praisonai-tools

Signal

Signal Tool

Send messages via Signal using signal-cli REST API.

Setup

  1. Install signal-cli REST API

    Run the signal-cli-rest-api Docker container:

    bash
    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
    export SIGNAL_CLI_URL=http://localhost:8080
    export SIGNAL_ACCOUNT=+1234567890

Usage

Basic
from praisonai_tools import SignalTool

signal = SignalTool()
result = signal.send_message(
    to="+1234567890",
    message="Hello from PraisonAI!"
)
With Agent
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")
Groups
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

ActionDescription
sendSend text message
send_typingSend typing indicator
send_receiptSend read receipt
send_reactionReact to a message
checkCheck connection status
list_groupsList all groups

LINE

LINE Tool

Send messages via LINE Messaging API.

Setup

  1. Create LINE Channel

    Go to LINE Developers Console and create a Messaging API channel.

  2. Get credentials

    Copy your Channel access token and Channel secret.

  3. Set environment variables
    bash
    export LINE_CHANNEL_ACCESS_TOKEN=your_token
    export LINE_CHANNEL_SECRET=your_secret

Usage

Push Message
from praisonai_tools import LineTool

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

line = LineTool()
result = line.broadcast(message="Hello everyone!")
Flex Message
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

ActionDescription
pushPush message to user
replyReply with token
multicastSend to multiple users
broadcastSend to all followers
get_profileGet user profile
get_quotaGet message quota

iMessage

iMessage Tool

Send messages via iMessage on macOS.

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

Basic
from praisonai_tools import iMessageTool

imsg = iMessageTool()
result = imsg.send_message(
    to="+1234567890",
    message="Hello from PraisonAI!"
)
Email Address
from praisonai_tools import iMessageTool

imsg = iMessageTool()
result = imsg.send_message(
    to="user@example.com",
    message="Hello!"
)
Check Availability
from praisonai_tools import iMessageTool

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

Actions

ActionDescription
sendSend message
checkCheck availability
list_chatsList recent chats

WhatsApp

WhatsApp Tool

Send messages via WhatsApp Business API.

Setup

  1. Create WhatsApp Business Account

    Set up a WhatsApp Business API account.

  2. Get credentials

    Copy your Access Token and Phone Number ID.

  3. Set environment variables
    bash
    export WHATSAPP_ACCESS_TOKEN=your_token
    export WHATSAPP_PHONE_NUMBER_ID=your_phone_id

Usage

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

FeatureSignalLINEiMessageWhatsAppTelegram
Text✅✅✅✅✅
Media✅✅❌✅✅
Groups✅✅✅✅✅
Reactions✅❌❌❌✅
Typing✅❌❌❌✅
Read Receipts✅❌❌✅✅
Broadcast❌✅❌✅✅
PlatformAnyAnymacOSAnyAny

Environment Variables

All Channel Environment Variables
VariableChannelDescription
SIGNAL_CLI_URLSignalsignal-cli REST API URL
SIGNAL_ACCOUNTSignalYour Signal phone number
LINE_CHANNEL_ACCESS_TOKENLINELINE channel access token
LINE_CHANNEL_SECRETLINELINE channel secret
IMESSAGE_API_URLiMessageREST API URL (optional)
IMESSAGE_MODEiMessage“applescript” or “rest”
WHATSAPP_ACCESS_TOKENWhatsAppWhatsApp Business API token
WHATSAPP_PHONE_NUMBER_IDWhatsAppPhone number ID
TELEGRAM_BOT_TOKENTelegramTelegram Bot API token
DISCORD_BOT_TOKENDiscordDiscord bot token
SLACK_BOT_TOKENSlackSlack bot token

Best Practices

Use channels for long-running agents

Channel-based communication is ideal for agents that need to send progress updates during execution.

Keep message payloads small

Send references (IDs, paths) rather than full data through channels to avoid memory issues.

Handle channel timeouts

Always set a timeout when waiting for channel messages to prevent agents from hanging.

Use typed messages

Define a message format for each channel to make inter-agent communication predictable.

Related