Skip to main content
AgentOS supports 15 messaging platforms with production-ready channel adapters. Each adapter handles platform-specific webhooks, authentication, and bidirectional messaging.

Telegram

Instant messaging with bot commands and inline responses.

Setup

1

Create Bot

Message @BotFather on Telegram:
/newbot
Your Bot Name
your_bot_username
Copy the bot token.
2

Configure Webhook

Set the webhook URL to your AgentOS instance:
curl -X POST https://api.telegram.org/bot<TOKEN>/setWebhook \
  -d "url=https://your-domain.com/webhook/telegram" \
  -d "secret_token=your-secret-token"
3

Store Credentials

agentos vault set TELEGRAM_BOT_TOKEN "your-bot-token"
agentos vault set TELEGRAM_SECRET_TOKEN "your-secret-token"
4

Enable Channel

agentos channel enable telegram
agentos channel test telegram

Features

  • Markdown message formatting
  • Automatic message splitting (4,096 char limit)
  • Webhook signature verification
  • Edit message support
  • Chat ID-based agent routing

Implementation

Source: src/channels/telegram.ts:1
registerFunction(
  { id: "channel::telegram::webhook" },
  async (req) => {
    const update = req.body;
    const message = update.message || update.edited_message;
    const chatId = message.chat.id;
    
    const agentId = await resolveAgent(trigger, "telegram", String(chatId));
    const response = await trigger("agent::chat", {
      agentId,
      message: message.text,
      sessionId: `telegram:${chatId}`
    });
    
    await sendMessage(chatId, response.content);
  }
);

Discord

Community chat and gaming server integration.

Setup

1

Create Application

Go to Discord Developer Portal
  • Create New Application
  • Go to Bot tab
  • Click “Add Bot”
  • Copy bot token
2

Configure Intents

Enable in Bot settings:
  • Server Members Intent
  • Message Content Intent
3

Store Credentials

agentos vault set DISCORD_BOT_TOKEN "your-bot-token"
4

Invite Bot

Generate OAuth2 URL with scopes: bot, permissions: Send Messages, Read Messages

Features

  • Channel-based routing
  • Bot mention filtering
  • Message splitting (2,000 char limit)
  • Embed support
Source: src/channels/discord.ts:1

Slack

Enterprise team communication.

Setup

1

Create Slack App

Go to api.slack.com/apps
  • Create New App
  • Choose “From scratch”
  • Select workspace
2

Configure Bot

In App Settings:
  • OAuth & Permissions → Add chat:write scope
  • Event Subscriptions → Enable Events
  • Subscribe to message.channels
  • Set Request URL to https://your-domain.com/webhook/slack/events
3

Store Credentials

agentos vault set SLACK_BOT_TOKEN "xoxb-..."
agentos vault set SLACK_SIGNING_SECRET "..."

Features

  • Thread-aware responses
  • Signature verification with timing-safe comparison
  • URL verification challenge handling
  • Message splitting (4,000 char limit)
Source: src/channels/slack.ts:1

WhatsApp

Customer support via WhatsApp Business API.

Setup

1

Get API Access

2

Configure Webhook

Set webhook URL in Meta Developer Console:
https://your-domain.com/webhook/whatsapp
3

Store Credentials

agentos vault set WHATSAPP_TOKEN "your-access-token"
agentos vault set WHATSAPP_PHONE_ID "your-phone-number-id"

Features

  • Business messaging API integration
  • Template message support
  • Message splitting (4,096 char limit)
  • Media message handling
Source: src/channels/whatsapp.ts:1

Microsoft Teams

Enterprise collaboration platform.

Setup

1

Register Bot

Go to Azure Portal
  • Create Azure Bot resource
  • Note App ID and generate App Password
2

Configure Messaging

Set messaging endpoint:
https://your-domain.com/webhook/teams
3

Store Credentials

agentos vault set TEAMS_APP_ID "..."
agentos vault set TEAMS_APP_PASSWORD "..."

Features

  • Bot Framework integration
  • OAuth2 token refresh
  • Conversation ID routing
  • Reply threading
Source: src/channels/teams.ts:1

Email

SMTP/IMAP email automation.

Setup

1

Configure SMTP

Set environment variables:
export SMTP_HOST="smtp.gmail.com"
export SMTP_PORT="587"
export SMTP_SECURE="false"
export SMTP_USER="[email protected]"
export SMTP_PASS="your-app-password"
2

Test Connection

agentos channel test email

Features

  • Nodemailer integration
  • Subject line handling
  • Reply thread continuity
  • HTML/plain text support
Source: src/channels/email.ts:1

Google Chat

Google Workspace integration.

Setup

1

Create Chat App

Go to Google Chat API Console
  • Enable Google Chat API
  • Create credentials
2

Store Credentials

agentos vault set GOOGLE_CHAT_TOKEN "..."
Source: src/channels/google-chat.ts:1

Signal

Encrypted messaging.

Setup

Requires signal-cli bridge.
agentos vault set SIGNAL_ACCOUNT "+1234567890"
Source: src/channels/signal.ts:1

Additional Messaging Platforms

IRC

Legacy chat networksSource: src/channels/irc.ts:1

Matrix

Decentralized chat protocolSource: src/channels/matrix.ts:1

XMPP

Open protocol messaging (Jabber)Source: src/channels/xmpp.ts:1

Viber

International messagingSource: src/channels/viber.ts:1

LINE

Asia-Pacific messagingSource: src/channels/line.ts:1

Messenger

Facebook Messenger integrationSource: src/channels/messenger.ts:1

Threema

Privacy-focused Swiss messagingSource: src/channels/threema.ts:1

Feishu/Lark

China enterprise marketSource: src/channels/feishu.ts:1

Multi-Platform Agent

Connect a single agent to multiple messaging platforms:
# Configure credentials for each platform
agentos vault set TELEGRAM_BOT_TOKEN "..."
agentos vault set DISCORD_BOT_TOKEN "..."
agentos vault set SLACK_BOT_TOKEN "..."

# Enable channels
agentos channel enable telegram
agentos channel enable discord
agentos channel enable slack

# All channels will route to your default agent
agentos agent chat default

Testing

# Test individual channel
agentos channel test telegram

# View webhook logs
agentos logs --follow | grep "channel::"

# Check audit trail
agentos security audit | grep "channel_message"

Message Splitting Logic

All messaging adapters automatically split long responses:
import { splitMessage } from "../shared/utils.js";

const chunks = splitMessage(response.content, platformLimit);
for (const chunk of chunks) {
  await sendMessage(recipientId, chunk);
}
PlatformLimitSource
Telegram4,096telegram.ts:66
Slack4,000slack.ts:65
Discord2,000discord.ts:50
WhatsApp4,096whatsapp.ts:65
Teams4,096teams.ts:94

Security

Webhook Signature Verification

Telegram (telegram.ts:19):
if (!verifyTelegramUpdate(secretToken, req)) {
  return { status_code: 401 };
}
Slack (slack.ts:32):
try {
  verifySlackSignature(req, signingSecret);
} catch (e) {
  return { status_code: 401, body: { error: e.message } };
}

Audit Events

Every channel message emits an audit event:
triggerVoid("security::audit", {
  type: "channel_message",
  agentId,
  detail: { channel: "telegram", chatId, userId }
});
View audit trail:
agentos security audit --type channel_message

Next Steps

Social Media

Connect to Bluesky, Reddit, Twitch, LinkedIn

Custom Adapters

Build your own channel adapter

Build docs developers (and LLMs) love