Channel Commands
Channels connect OpenFang agents to messaging platforms. OpenFang supports 40 messaging platforms including Telegram, Discord, Slack, WhatsApp, Signal, Matrix, and more.
openfang channel list
List configured channels and their status.
Output
CHANNEL ENV VAR STATUS
---------------------------------------------------------------
webchat (built-in) Ready
telegram TELEGRAM_BOT_TOKEN Ready
discord DISCORD_BOT_TOKEN Missing env
slack SLACK_BOT_TOKEN Not configured
whatsapp WHATSAPP_API_KEY Not configured
signal SIGNAL_PHONE_NUMBER Not configured
matrix MATRIX_HOMESERVER_URL Not configured
email EMAIL_SMTP_HOST Not configured
Status Values
Status Description ReadyChannel is configured and credentials are available Missing envConfiguration exists but environment variable is missing Not configuredNo configuration block in config.toml
Checked Channels
webchat — Built-in web UI (always ready)
telegram — Telegram Bot API
discord — Discord Bot
slack — Slack Bot
whatsapp — WhatsApp Business API
signal — Signal Messenger
matrix — Matrix Protocol
email — SMTP/IMAP
And 32 more (LINE, Mastodon, Twitter/X, Facebook, Instagram, WeChat, etc.).
Example
openfang channel setup
Interactive setup wizard for a channel integration.
openfang channel setup [<CHANNEL>]
Arguments
Argument Description <CHANNEL>Channel name (e.g., telegram, discord, slack). If omitted, displays an interactive picker.
Supported Channels
telegram
discord
slack
whatsapp
email
signal
matrix
Wizard Steps
Each wizard:
Displays step-by-step instructions for obtaining credentials
Prompts for tokens/credentials
Saves tokens to ~/.openfang/.env with owner-only permissions (0600 on Unix)
Appends the channel configuration block to config.toml (prompts for confirmation)
Warns to restart the daemon if one is running
Examples
Interactive Picker
Telegram
Discord
Slack
# Show list of available channels
openfang channel setup
openfang channel setup telegram
Steps:
Open https://t.me/BotFather
Send /newbot and follow instructions
Copy the bot token (looks like 123456:ABC-DEF...)
Paste when prompted
Configuration is saved to .env and config.toml
openfang channel setup discord
Steps:
Go to https://discord.com/developers/applications
Click “New Application”
Go to “Bot” tab → “Add Bot”
Copy the bot token
Enable “MESSAGE CONTENT INTENT”
Paste token when prompted
openfang channel setup slack
Steps:
Go to https://api.slack.com/apps
Create a new app
Add bot token scopes: chat:write, channels:history, im:history
Install app to workspace
Copy “Bot User OAuth Token”
Paste when prompted
Example Session (Telegram)
openfang channel setup telegram
Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Telegram Bot Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1: Create a Telegram bot
1. Open https://t.me/BotFather in Telegram
2. Send /newbot
3. Follow the instructions to create your bot
4. Copy the bot token (looks like 123456:ABC-DEF...)
Step 2: Enter your bot token
Bot token: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz
✓ Token saved to ~/.openfang/.env
✓ Testing token... OK
Step 3: Add configuration to config.toml
[[channels]]
type = "telegram"
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"
Add this to config.toml? [Y/n]: y
✓ Configuration added to ~/.openfang/config.toml
Done! Telegram channel is now configured.
⚠ Restart the daemon to apply changes:
openfang stop && openfang start
Next steps:
1. Start the daemon: openfang start
2. Get your bot username from @BotFather
3. Send a message to your bot on Telegram
4. The agent will respond automatically
openfang channel test
Send a test message through a configured channel.
openfang channel test < CHANNE L >
Arguments
Argument Description <CHANNEL>Channel name to test (e.g., telegram, discord).
Behavior
Requires a running daemon. Sends POST /api/channels/<channel>/test.
This command requires the daemon to be running. Start it with:
Examples
# Test Telegram channel
openfang channel test telegram
# Test Discord channel
openfang channel test discord
# Test Slack channel
openfang channel test slack
Example Output
Testing telegram channel...
✓ Test message sent successfully!
Check your Telegram bot to confirm you received:
"Test message from OpenFang at 2026-03-07 14:23:45"
openfang channel enable
Enable a channel integration.
openfang channel enable < CHANNE L >
Arguments
Argument Description <CHANNEL>Channel name to enable.
Behavior
Daemon mode : Sends POST /api/channels/<channel>/enable. Channel starts immediately.
Without daemon : Prints a note that the change will take effect on next start.
Examples
# Enable Discord channel
openfang channel enable discord
# Enable Slack channel
openfang channel enable slack
Output
✓ Discord channel enabled
The channel is now active and will receive messages.
openfang channel disable
Disable a channel without removing its configuration.
openfang channel disable < CHANNE L >
Arguments
Argument Description <CHANNEL>Channel name to disable.
Behavior
Daemon mode : Sends POST /api/channels/<channel>/disable. Channel stops immediately.
Without daemon : Prints a note to edit config.toml and set enabled = false.
Examples
# Disable Discord channel (keeps config)
openfang channel disable discord
# Disable Telegram channel
openfang channel disable telegram
Output
✓ Discord channel disabled
The channel is now inactive. Configuration is preserved.
To re-enable: openfang channel enable discord
Complete Channel Setup Example
Setup Telegram
openfang channel setup telegram
Follow the wizard to get your bot token from @BotFather.
Restart Daemon
openfang stop
openfang start
Test the Channel
openfang channel test telegram
Start Chatting
Send a message to your bot on Telegram. The agent will respond automatically!
Channel configurations are stored in ~/.openfang/config.toml:
[[ channels ]]
type = "telegram"
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"
[[ channels ]]
type = "discord"
enabled = false
bot_token_env = "DISCORD_BOT_TOKEN"
guild_id = "123456789"
[[ channels ]]
type = "slack"
enabled = true
bot_token_env = "SLACK_BOT_TOKEN"
signing_secret_env = "SLACK_SIGNING_SECRET"
Credentials are stored in ~/.openfang/.env:
TELEGRAM_BOT_TOKEN = 123456789:ABCdefGHIjklMNOpqrsTUVwxyz
DISCORD_BOT_TOKEN = MTIzNDU2Nzg5MDEyMzQ1Njc4OTAuGhI-Jk.LmNoP_qRsTuVwXyZaBcDeFgHiJkLmN
SLACK_BOT_TOKEN = xoxb-1234567890-1234567890-ABCdefGHIjklMNOpqrsTUVw
SLACK_SIGNING_SECRET = 0123456789abcdef0123456789abcdef
The .env file contains secrets. It is automatically created with owner-only permissions (0600 on Unix). Never commit it to version control.
LINE
WeChat
Viber
Threema
Wire
Keybase
Mattermost
Rocket.Chat
Zulip
IRC
XMPP
Gitter
Next Steps
Agent Commands Connect agents to channels
Channel Development Create custom channel adapters
Channel API Manage channels via REST API
CLI Overview Back to CLI overview