How channel bots work
Channel bots bring Claude into your team's messaging platform. Each bot connects to a platform via WebSocket or Stream API (no public webhook server needed), receives messages, routes them through Claude, and sends responses back — including streaming card updates for real-time output.
The setup flow for all platforms follows the same pattern: create an app on the platform's developer console → configure permissions → paste credentials into Onevium → start the bot.
Feishu (Lark) setup
Feishu bots connect via WebSocket using the Lark SDK. No public server or webhook URL is needed.
- Step 1: Go to the Feishu Open Platform (open.feishu.cn) and create a new application.
- Step 2: In the app settings, enable the Bot capability under Features > Bot.
- Step 3: Under Permissions & Scopes, add these permissions: im:message (send messages), im:message:patch (edit messages for streaming), contact:user.base:readonly (resolve user names), im:chat:readonly (resolve chat names).
- Step 4: For streaming card support, also add: cardkit:card (create and update interactive cards). Without this permission, the bot falls back to plain text messages.
- Step 5: Under Event Subscriptions, enable the WebSocket mode (not HTTP callback). This lets the bot receive messages without exposing a public endpoint.
- Step 6: Subscribe to the im.message.receive_v1 event to receive incoming messages.
- Step 7: If using interactive cards with button callbacks, also subscribe to the card.action.trigger event.
- Step 8: Copy the App ID and App Secret from the Credentials page.
- Step 9: In Onevium, go to Channels > Create Bot > Feishu. Paste the App ID and App Secret.
- Step 10: Click Start — Onevium establishes a WebSocket connection to Feishu and begins listening for messages.
- Step 11: Add the bot to a Feishu group, or send it a direct message to verify it works.
Feishu message formats
Feishu bots support two message delivery modes, chosen automatically based on available permissions:
- CardKit streaming (preferred): Creates an interactive card that updates in real-time as Claude generates output. Requires the cardkit:card permission. The card uses v2.0 schema with markdown rendering.
- IM message fallback: If CardKit permissions are unavailable, the bot sends standard interactive messages and patches them during streaming. Less smooth but fully functional.
- Messages longer than 8,000 characters are automatically split into multiple messages.
DingTalk setup
DingTalk bots use the Stream protocol for real-time bidirectional communication. Like Feishu, no public server is required.
- Step 1: Go to the DingTalk Open Platform (open.dingtalk.com) and create an enterprise internal application (H5 micro-app).
- Step 2: Under Application Capabilities, enable the Bot capability.
- Step 3: In the bot settings, enable the Stream mode (not HTTP callback). This is required — Onevium connects via the DingTalk Stream SDK.
- Step 4: Copy the Client ID (AppKey) and Client Secret (AppSecret) from the application credentials page.
- Step 5: In Onevium, go to Channels > Create Bot > DingTalk. Paste the App Key and App Secret.
- Step 6: Click Start — Onevium registers a stream listener and starts consuming messages.
- Step 7: Add the bot to a DingTalk group. In groups, the bot only responds when @mentioned. In DMs, it responds to all messages.
DingTalk streaming cards
DingTalk supports AI streaming cards for real-time output display. Onevium uses the official AI card template for markdown streaming.
- Streaming flow: The bot creates a card instance → streams content updates (INPUTING state) → finalizes the card (FINISHED or FAILED state).
- If card creation fails (e.g., template not enabled), the bot falls back to standard markdown messages.
- Messages up to 20,000 characters are supported. Longer outputs are automatically split.
Discord setup
Discord bots connect via the discord.js WebSocket gateway.
- Step 1: Go to the Discord Developer Portal (discord.com/developers/applications) and create a new application.
- Step 2: Go to the Bot section and click Add Bot.
- Step 3: Under Privileged Gateway Intents, enable: Message Content Intent (required for reading message text).
- Step 4: Copy the Bot Token from the Bot page. Keep this secret.
- Step 5: Generate an invite URL under OAuth2 > URL Generator. Select the bot scope and these permissions: Send Messages, Read Message History, Attach Files, Embed Links.
- Step 6: Use the invite URL to add the bot to your Discord server.
- Step 7: In Onevium, go to Channels > Create Bot > Discord. Paste the Bot Token.
- Step 8: Click Start — Onevium connects via the Discord gateway and begins listening.
- Step 9: In a server channel, @mention the bot to start a conversation. In DMs, just send a message directly.
Discord message handling
Discord bots use message editing for streaming previews. While Claude is generating, the bot posts a preview message and updates it every 1.5 seconds. When complete, the preview is replaced with the final output.
Discord has a 2,000 character limit per message. Longer responses are automatically split across multiple messages. File attachments are sent as multipart uploads.
Session modes
Each channel bot supports two conversation session modes:
- Per-user sessions (default): Each user gets their own isolated conversation. User A's history is invisible to User B. Best for developer-facing bots.
- Shared sessions: All users in a channel share one conversation. Messages from different people contribute to the same context. Best for team channels like incident response or ops monitoring.
Bot configuration options
Each bot has detailed controls for behavior, access, and capability scoping:
- Mode — Code (full tool access), Plan (propose changes before executing), or Ask (read-only, no tool calls).
- Auto-approve — None (ask before each action), Read (auto-approve file reads), or All (auto-approve everything).
- Chat scope — Both (groups + DMs), Group only, or DM only.
- DM policy — Open (anyone can DM) or Allowlist (only specified user IDs).
- Model override — Run this bot on a specific model (Opus, Sonnet, Haiku) independent of the global default.
- System prompt — Define the bot's role and behavior boundaries.
- MCP servers — Attach additional MCP tools beyond the defaults.
- Offline message — Custom reply when the bot is disabled.
Bot clusters
Group related bots into clusters for multi-bot setups. A cluster shares the same platform and working directory. For example, a release cluster with @qa-bot, @docs-bot, and @deploy-bot working on the same repository.
Enable cross-bot query in chat settings to let bots reference each other's conversation history — @qa-bot finds a bug, @dev-bot picks up the context without manual copying.