Connectors
Connectors bridge your agents to chat platforms. Messages sent to the bot on any platform are routed to the assigned agent, and responses are sent back.
Supported Platforms
| Platform | Library | Auth Method |
|---|---|---|
| Discord | discord.js | Bot token |
| Slack | @slack/bolt | Bot token + App token |
| Telegram | grammy | Bot token |
| baileys | QR code pairing | |
| BlueBubbles | Webhook bridge | Server URL + password |
| Signal | signal-cli | signal-cli account |
| Microsoft Teams | botbuilder | Bot Framework credentials |
| Google Chat | googleapis | Service account |
| Matrix | matrix-bot-sdk | Homeserver URL + access token |
| OpenClaw | Gateway protocol | OpenClaw gateway credentials |
Discord
- Create a bot at Discord Developer Portal
- Copy the Bot Token
- In SwarmClaw, go to Connectors > New Connector
- Select Discord, paste the token, and choose an agent
- Add channel IDs the bot should respond in (comma-separated)
- Enable and start the connector
The bot needs the MESSAGE_CONTENT intent enabled in the developer portal.
Slack
- Create a Slack app at api.slack.com
- Enable Socket Mode and generate an App-Level Token
- Add Bot Token Scopes:
chat:write,app_mentions:read - Install to your workspace and copy the Bot Token
- In SwarmClaw, create a Slack connector with both tokens
- The bot responds to mentions (
@YourBot) in channels it's invited to
Telegram
- Message @BotFather on Telegram
- Create a new bot and copy the token
- In SwarmClaw, create a Telegram connector with the token
- The bot responds to all direct messages and group mentions
- In SwarmClaw, create a WhatsApp connector
- A QR code appears in the connector sheet
- Open WhatsApp on your phone > Linked Devices > Link a Device
- Scan the QR code
- The connector links to your WhatsApp account
Note: WhatsApp uses the Baileys library (unofficial). The QR code may need to be re-scanned periodically.
WhatsApp Message Formatting
Connector replies are normalized to WhatsApp-friendly plain text before send, so markdown-heavy model output does not leak raw ** / backticks / link syntax in chats.
Inbound Voice Notes
Inbound voice notes are auto-transcribed before they reach the agent when STT is configured.
- Preferred STT order: ElevenLabs first, then OpenAI fallback
- If neither key is configured, the connector inserts a clear "transcription unavailable" note instead of silent failure
- If transcription fails, the connector inserts a clear failure note for the agent/user thread
Outbound Voice Notes
When an agent sends a WhatsApp voice note through connector_message_tool, SwarmClaw uses your configured ElevenLabs voice if one is available.
- If the configured default voice is rejected by ElevenLabs as a paid-only/library voice, SwarmClaw automatically retries with the built-in fallback voice
- This keeps outbound WhatsApp voice-note delivery working even when an older saved default voice is no longer usable on the current ElevenLabs plan
- Configure IMAP/SMTP credentials in the connector settings
- Set polling interval for inbound email checks
- Assign an agent to handle inbound messages
- The connector converts email threads to chat context for the agent
Connector Health Monitoring
The daemon automatically monitors running connectors for liveness:
- Each connector exposes an
isAlive()check (socket/connection state) - The daemon polls every 2 minutes and detects dead connectors
- Failed connectors are auto-restarted with exponential backoff (30s base, 15min max, up to 3 wake attempts)
- Health events are logged and trigger in-app notifications
- Persistent failures result in a warning notification without further restart attempts
Managing Connectors
Each connector shows its status: running, stopped, or error. Use the toggle to start/stop connectors. Error details are displayed when something goes wrong.
Running connectors also expose a lightweight presence indicator based on last inbound activity:
- Active — message seen in the last 5 minutes
- Xm ago — recent activity within the last 30 minutes
- Inactive — no recent inbound activity
Connector Doctor
Connector Doctor helps preview routing and policy problems before or after you save a connector.
- Existing connector diagnostics:
GET /api/connectors/:id/doctor - Existing connector preview with temporary overrides:
POST /api/connectors/:id/doctor - Draft connector preview before save:
POST /api/connectors/doctor
The report highlights warning conditions such as:
- Connector not currently running
- Missing or risky routing policy
- Agent/chatroom assignment issues
- Sample inbound-message policy problems
CLI equivalents:
swarmclaw connectors doctor <connectorId>
swarmclaw connectors doctor-preview <connectorId> --data '{"sampleMsg":{"text":"hello"}}'
swarmclaw connectors doctor-draft --data '{"platform":"telegram","agentId":"<agentId>","config":{"token":"***"}}'
Task Follow-Ups Over Connectors
When connector task follow-ups are enabled, completion updates prefer the same connector/channel that initiated the task. If the task generated a sendable local artifact, that file can be attached to the outbound follow-up message.
Pairing & Safety Policy
Connectors can be configured with dmPolicy: allowlist to block unknown senders until approved.
- Unknown senders receive a pairing code response.
- Approved admins can manage codes using
/paircommands. /pair approve <code>allows that sender for future messages./pair listshows pending/approved entries.
This is useful when you expose connectors to shared channels and want strict sender control.