All 40 Supported Channels
Core Messaging (7)
Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email
Enterprise (8)
Microsoft Teams, Mattermost, Google Chat, Webex, Feishu/Lark, Rocket.Chat, Zulip, XMPP
Social (8)
LINE, Viber, Facebook Messenger, Mastodon, Bluesky, Reddit, LinkedIn, Twitch
Community (6)
IRC, Guilded, Revolt, Keybase, Discourse, Gitter
Privacy (3)
Threema, Nostr, Mumble
Workplace (4)
Pumble, Flock, Twist, DingTalk
Notification (2)
ntfy, Gotify
Integration (2)
Webhook (Generic HTTP), Nextcloud Talk
Quick Start — Core Channels
- Telegram
- Discord
- Slack
- WhatsApp
- Matrix
- Email
Prerequisites
- A Telegram bot token from @BotFather
Setup
- Open Telegram and message
@BotFather - Send
/newbotand follow the prompts - Copy the bot token
Configuration
How It Works
Long-polling viagetUpdates API. Polls every few seconds with 30-second timeout. Messages from authorized users route to the configured agent. Responses sent via sendMessage API. Long messages automatically split at Telegram’s 4096-character limit.Channel Configuration
All channels are configured in~/.openfang/config.toml under the [channels] section:
Common Configuration Fields
Environment variable holding the bot/access token. All secrets stored as
Zeroizing<String> and wiped from memory on drop.Agent name or ID that receives messages when no specific routing applies.
Optional list of platform user IDs allowed to interact. Empty means allow all.
Per-channel behavior overrides (see Channel Overrides section below).
Channel Overrides
Customize agent behavior per channel without modifying agent manifests:Override Fields
Override the LLM model for this channel. Uses agent’s default if not set.
Override the system prompt for this channel.
How to handle direct messages:
respond— Respond to all DMs (default)allowed_only— Only respond to DMs from users inallowed_usersignore— Silently drop all DMs
How to handle group/channel messages:
all— Respond to all messages in the groupmention_only— Only respond when bot is @mentioned (default)commands_only— Only respond to/commandmessagesignore— Ignore all group messages
Max messages per minute per user.
0 = unlimited. Uses sliding-window rate limiter.Send replies as thread responses on platforms that support it (Slack, Discord, etc.).
Output format for this channel:
markdown— Standard Markdown (default)telegram_html— Telegram HTML subset (<b>,<i>,<code>)slack_mrkdwn— Slack mrkdwn format (*bold*,_italic_,`code`)plain_text— No formatting markup
Override usage footer mode for this channel:
off, tokens, cost, or full.Output Formatter
The formatter converts Markdown output from the LLM into platform-native formats:- Markdown (Default)
- Telegram HTML
- Slack Mrkdwn
- Plain Text
Standard Markdown passed through as-is. Works on most platforms.
Rate Limiting
Per-user rate limiting uses a sliding-window algorithm. Whenrate_limit_per_user is set, the limiter tracks message counts per user. Excess messages receive a polite rejection. Rate limits are enforced before messages reach the agent loop, consuming zero LLM tokens.
DM and Group Policies
Policy enforcement happens indispatch_message() before messages reach the agent:
DM Policy Behavior
| Policy | Behavior |
|---|---|
respond | Respond to all DMs (default) |
allowed_only | Only respond to DMs from users in allowed_users |
ignore | Silently drop all DMs |
Group Policy Behavior
| Policy | Behavior |
|---|---|
all | Respond to every message in the group |
mention_only | Only respond when bot is @mentioned (default) |
commands_only | Only respond to /command messages |
ignore | Silently ignore all group messages |
Ignored messages consume zero LLM tokens since they’re filtered before reaching the agent.
Enterprise Channels
Microsoft Teams
Microsoft Teams
Protocol: Bot Framework v3 webhook + OAuth2Environment Variables:
TEAMS_APP_ID— Azure Bot App IDTEAMS_APP_PASSWORD— Azure Bot Framework app password
Mattermost
Mattermost
Protocol: WebSocket + REST v4Environment Variables:
MATTERMOST_TOKEN— Bot tokenMATTERMOST_URL— Server URL
Google Chat
Google Chat
Protocol: Service account webhookEnvironment Variables:
GOOGLE_CHAT_SERVICE_ACCOUNT— Service account JSON key
Webex
Webex
Environment Variables:
WEBEX_BOT_TOKENFeishu / Lark
Feishu / Lark
Environment Variables:
FEISHU_APP_ID, FEISHU_APP_SECRETSocial Platforms
Mastodon
Mastodon
Protocol: Streaming API WebSocket
Bluesky
Bluesky
Protocol: AT Protocol WebSocket
Reddit
Protocol: OAuth2 polling
Twitch
Twitch
Protocol: IRC gateway
Privacy-Focused Channels
- Signal
- Threema
- Nostr
Agent Routing
TheAgentRouter determines which agent receives incoming messages:
- Per-channel default — Each channel config has a
default_agentfield - User-agent binding — Users previously associated with specific agents route to those agents
- Command prefix — Users can switch agents:
/agent coder - Fallback — Messages go to the first available agent
Environment Variables Reference
Telegram Bot API token from @BotFather
Discord bot token
Slack bot token (
xoxb-) for REST APISlack app-level token (
xapp-) for Socket ModeWhatsApp Cloud API access token
Webhook verification token
Matrix homeserver access token
Email account password or app password
Azure Bot Framework app password
Mattermost bot token
See full environment variable reference in configuration.md for all 40 channels.
Security
- All secrets wrapped in
Zeroizing<String>— wiped from memory on drop - Subprocess environment cleared with
env_clear()— only whitelisted vars passed through - Webhook endpoints validate signatures (HMAC-SHA256) where supported
- Rate limiting protects against abuse
- Policy enforcement happens before agent loop — ignored messages consume zero LLM tokens
