Skip to main content
OpenFang supports 40+ messaging platforms through channel adapters. Each channel can have custom behavior policies, rate limits, and per-channel model overrides.

Supported Channels

OpenFang supports these messaging platforms:

Core Platforms

Telegram

Popular messaging with bot API

Discord

Gaming and community platform

Slack

Enterprise team communication

WhatsApp

Global messaging leader

Signal

Privacy-focused messaging

Matrix

Decentralized protocol

Email

IMAP/SMTP support

Enterprise

Microsoft Teams

Office 365 integration

Mattermost

Self-hosted Slack alternative

Google Chat

Workspace messaging

Webex

Cisco collaboration

Feishu/Lark

ByteDance workplace

Zulip

Threaded conversations

Social & Community

LINE

Popular in Asia

Viber

Global messaging

Facebook Messenger

Meta platform

Mastodon

Federated social

Bluesky

AT Protocol

Reddit

Community discussions

LinkedIn

Professional network

Twitch

Live streaming chat

Privacy & Open Source

Threema

Swiss privacy messaging

Nostr

Decentralized protocol

Mumble

Low-latency voice

Nextcloud Talk

Self-hosted chat

Rocket.Chat

Open source platform

Ntfy

Push notifications

Gotify

Self-hosted notifications

Legacy & Niche

IRC

Classic protocol

XMPP

Extensible messaging

Guilded

Gaming communities

Revolt

Discord alternative

Keybase

Crypto messaging

Discourse

Forum platform

Gitter

Developer chat

Pumble

Team messaging

Flock

Business messaging

Twist

Async communication

DingTalk

Alibaba workplace

Zalo

Vietnamese messaging

Webhooks

Custom integrations

Quick Setup Examples

Telegram

[telegram]
bot_token_env = "TELEGRAM_BOT_TOKEN"
allowed_users = []  # Empty = allow all users
Setup Steps:
  1. Message @BotFather on Telegram
  2. Send /newbot and follow the prompts
  3. Copy the bot token
  4. Add token to environment variable
  5. Start OpenFang
bot_token_env
string
required
Environment variable containing the Telegram bot token
allowed_users
array
List of Telegram user IDs allowed to interact. Empty array = allow all.

Discord

[discord]
bot_token_env = "DISCORD_BOT_TOKEN"
guild_ids = []  # Empty = all guilds
Setup Steps:
  1. Go to Discord Developer Portal
  2. Create a new application
  3. Go to “Bot” section and create a bot
  4. Copy the bot token
  5. Enable “Message Content Intent” in bot settings
  6. Invite bot to your server using OAuth2 URL
bot_token_env
string
required
Environment variable containing the Discord bot token
guild_ids
array
List of Discord guild (server) IDs. Empty = respond in all guilds.

Slack

[slack]
bot_token_env = "SLACK_BOT_TOKEN"
app_token_env = "SLACK_APP_TOKEN"
Setup Steps:
  1. Go to Slack API
  2. Create a new app (“From scratch”)
  3. Enable Socket Mode
  4. Add bot token scopes: chat:write, app_mentions:read, channels:history
  5. Install app to workspace
  6. Copy both Bot Token and App Token
bot_token_env
string
required
Environment variable containing the Slack bot token (starts with xoxb-)
app_token_env
string
required
Environment variable containing the Slack app token (starts with xapp-)

WhatsApp

[whatsapp]
phone_number_id_env = "WHATSAPP_PHONE_NUMBER_ID"
access_token_env = "WHATSAPP_ACCESS_TOKEN"
verify_token_env = "WHATSAPP_VERIFY_TOKEN"
Setup Steps:
  1. Go to Meta for Developers
  2. Create a new app with WhatsApp product
  3. Get phone number ID from WhatsApp API settings
  4. Generate a permanent access token
  5. Configure webhook with your verify token

Channel Behavior Policies

Each channel can have custom behavior policies:
[telegram.overrides]
dm_policy = "respond"            # "respond", "allowed_only", "ignore"
group_policy = "mention_only"    # "all", "mention_only", "commands_only", "ignore"
rate_limit_per_user = 10         # Messages per minute (0 = unlimited)
threading = true                 # Enable thread replies
output_format = "markdown"       # "markdown", "telegram_html", "slack_mrkdwn", "plain_text"
usage_footer = "off"             # "off", "tokens", "cost", "full"

DM Policy

dm_policy
enum
default:"respond"
How to handle direct messages:
  • respond: Reply to all DMs
  • allowed_only: Only reply to users in allowed list
  • ignore: Ignore all DMs

Group Policy

group_policy
enum
default:"mention_only"
How to handle group messages:
  • all: Respond to all messages in group
  • mention_only: Only respond when @mentioned
  • commands_only: Only respond to slash commands
  • ignore: Ignore all group messages

Rate Limiting

rate_limit_per_user
integer
default:"10"
Maximum messages per user per minute. Set to 0 for unlimited.

Output Formatting

output_format
enum
Format of agent responses:
  • markdown: Standard Markdown (default)
  • telegram_html: Telegram HTML subset
  • slack_mrkdwn: Slack’s mrkdwn format
  • plain_text: No formatting

Per-Channel Model Override

Use different models for different channels:
# Use fast, cheap model for Telegram
[telegram.overrides]
model = "claude-haiku-4.5-20251001"

# Use premium model for enterprise Slack
[slack.overrides]
model = "claude-opus-4-20250514"

# Use local model for privacy-focused Signal
[signal.overrides]
model = "llama3.2:latest"
provider = "ollama"

Advanced Channel Configuration

Discord with Custom Intents

[discord]
bot_token_env = "DISCORD_BOT_TOKEN"
guild_ids = ["123456789012345678", "987654321098765432"]

[discord.overrides]
group_policy = "all"              # Respond to all messages
threading = true                  # Use Discord threads
output_format = "markdown"

Slack with Socket Mode

[slack]
bot_token_env = "SLACK_BOT_TOKEN"
app_token_env = "SLACK_APP_TOKEN"

[slack.overrides]
dm_policy = "respond"
group_policy = "mention_only"
rate_limit_per_user = 20
output_format = "slack_mrkdwn"

Telegram with Allowed Users

[telegram]
bot_token_env = "TELEGRAM_BOT_TOKEN"
allowed_users = [123456789, 987654321]  # Telegram user IDs

[telegram.overrides]
dm_policy = "allowed_only"
group_policy = "mention_only"
rate_limit_per_user = 30

Matrix with Encryption

[matrix]
homeserver_url = "https://matrix.org"
username_env = "MATRIX_USERNAME"
password_env = "MATRIX_PASSWORD"
encryption = true

Email Channel (IMAP/SMTP)

[email]
imap_host = "imap.gmail.com"
imap_port = 993
smtp_host = "smtp.gmail.com"
smtp_port = 587
username_env = "EMAIL_USERNAME"
password_env = "EMAIL_PASSWORD"  # Use app password for Gmail

[email.overrides]
rate_limit_per_user = 5  # Prevent email spam
output_format = "plain_text"

Webhook Channel

[webhook_trigger]
enabled = true
token_env = "OPENFANG_WEBHOOK_TOKEN"  # Must be 32+ chars
max_payload_bytes = 65536
rate_limit_per_minute = 30
Trigger agents via HTTP:
curl -X POST http://localhost:4200/hooks/agent \
  -H "Authorization: Bearer $OPENFANG_WEBHOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "researcher",
    "message": "Research quantum computing trends"
  }'

Typing Indicators

Show “typing…” indicators while agent is thinking:
[telegram.overrides]
typing_mode = "on"  # "on", "off", or "long_only"

[discord.overrides]
typing_mode = "long_only"  # Only for responses >10 seconds

Multi-Channel Agent

Configure an agent to work across multiple channels:
# Telegram for personal use
[telegram]
bot_token_env = "TELEGRAM_BOT_TOKEN"
allowed_users = [123456789]

[telegram.overrides]
model = "claude-sonnet-4-20250514"
usage_footer = "full"

# Discord for community support
[discord]
bot_token_env = "DISCORD_BOT_TOKEN"
guild_ids = []

[discord.overrides]
model = "claude-haiku-4.5-20251001"  # Cheaper for public
group_policy = "mention_only"
rate_limit_per_user = 5
usage_footer = "off"

# Slack for enterprise
[slack]
bot_token_env = "SLACK_BOT_TOKEN"
app_token_env = "SLACK_APP_TOKEN"

[slack.overrides]
model = "claude-opus-4-20250514"  # Premium for work
dm_policy = "respond"
group_policy = "all"
rate_limit_per_user = 30
usage_footer = "cost"

Channel Health Check

Verify channel connectivity:
# List all configured channels
openfang channels list

# Test a specific channel
openfang channels test telegram

# Check channel status
openfang channels status

Troubleshooting

Bot Not Responding

  1. Check token: echo $TELEGRAM_BOT_TOKEN
  2. Verify permissions: Ensure bot has required scopes
  3. Check logs: openfang logs --follow
  4. Test connection: openfang channels test telegram

Rate Limit Errors

Adjust per-user rate limits:
[telegram.overrides]
rate_limit_per_user = 20  # Increase from default 10

Group Messages Ignored

Ensure group policy allows responses:
[discord.overrides]
group_policy = "mention_only"  # or "all"

Permission Errors (Discord)

Enable required intents in Discord Developer Portal:
  • Message Content Intent
  • Guild Members Intent (for user info)

Next Steps

Security Settings

Configure authentication and rate limiting

Model Configuration

Setup LLM providers and routing