Channels
Connect Discord, Feishu / Lark, WeChat, and QQ to a Cohub Space, bind channels, configure model and @mention rules, and understand Chat mapping and System labels.
This page explains how to connect external messaging platforms—Discord, Feishu / Lark, WeChat, and QQ—to your Cohub account, bind a channel to a Space so messages arrive as Space Chats and replies route back, configure per-channel models and @mention rules, and diagnose connection health issues.
Supported platforms
Channels use a two-step workflow: first create a channel under your account in Account Settings → Channels (/settings/channels), then bind it to a Space in Space Settings → Channels. Each channel can be bound to at most one Space at a time.
Cohub supports four external messaging platforms:
| Platform | Setup method | Fields in New Channel (/settings/channels/new) |
External platform prerequisites |
|---|---|---|---|
| Discord | Bot token | Channel Name, Bot Token | Create or select an application in the Discord Developer Portal, copy the bot token, enable Message Content Intent, and invite the bot with the OAuth2 bot scope. |
| Feishu / Lark | App credentials | Channel Name, Platform (Feishu or Lark (International)), App ID, App Secret |
Create an Enterprise Self-built app in the Feishu / Lark console, enable Bot capability, configure Long Connection event subscriptions, and publish the app. |
| QR scan login | Channel Name, then click Start WeChat Binding | Open the scan page within 10 minutes, scan the QR code with WeChat, and confirm on your phone (enter the 6-digit verification code if prompted). | |
| QQ Bot | App credentials | Channel Name, App ID, Client Secret | Create or select a bot on QQ Open Platform (q.qq.com), copy App ID and Client Secret, enable C2C and group message events, and ensure the bot has QQ WebSocket gateway access. |
Connect a channel in Account Settings
Open Account Settings → Channels (/settings/channels) and click Add Channel (/settings/channels/new), then choose a platform:
Discord
- In the Discord Developer Portal, create or open an application, open the Bot page, and reset/copy the Bot Token.
- Enable Message Content Intent on the Bot page and invite the bot to your server with the OAuth2
botscope. - In Cohub, enter Channel Name and Bot Token, then click Save Channel.
Feishu / Lark
- In the Feishu or Lark Developer Console, create an Enterprise Self-built app and open Credentials & Basic Info.
- Copy the App ID (format
cli_...) and App Secret. - Enable Bot capability, switch event subscriptions to Long Connection, and publish the app.
- In Cohub, enter Channel Name, select Platform (Feishu or Lark (International)), paste App ID and App Secret, and click Save Channel.
WeChat channels use a QR login session rather than manually pasted tokens:
- Enter Channel Name (shown inside Cohub to identify the channel) and click Start WeChat Binding.
- Cohub starts a 10-minute login session and displays a countdown timer with Open Scan Page to Bind.
- Open the scan page, scan the QR code in WeChat, and confirm on your phone.
- If WeChat prompts for a 6-digit verification code, enter it in the verification field and click Continue.
- Once confirmed, the channel is saved automatically and redirects back to
/settings/channels. Re-scanning an already-connected WeChat account refreshes its credentials instead of creating a duplicate entry.
QQ Bot
- On QQ Open Platform (
q.qq.com), create or select a bot and open Developer Settings. - Copy the App ID and Client Secret, and enable C2C and group message events.
- In Cohub, enter Channel Name, App ID, and Client Secret, then click Save Channel.
Bind and configure a channel in a Space
Creating a channel stores it in your account in the Not bound state. To start receiving and replying to messages, bind it to a Space:
- Open Space Settings → Channels (requires
channel.manage, held by Spacehosts;builders have read-onlychannel.view). - Choose one of your unbound channels from Select a channel… and click Bind.
- Configure per-binding options directly on the bound channel row:
- Model: Pick a default model for messages arriving through this channel. External users can still override the model per conversation with
/model. - Discord mention rule: Require @mention in Discord server channels is checked by default (
requireMentionInGuild: true). Direct messages always trigger without a mention. - Feishu / Lark mention rule: Require @mention in Feishu groups is checked by default (
requireMentionInGroup: true). One-to-one (p2p) chats always trigger without a mention. - QQ Bot mention rule: Group messages require
@mentionby default (GROUP_AT_MESSAGE_CREATEor explicit bot mention); C2C direct messages always trigger.
- Model: Pick a default model for messages arriving through this channel. External users can still override the model per conversation with
Connection health states
Both Account Settings → Channels and Space Settings → Channels display each bound channel's live gateway health badge:
- Not bound (
unbound) — Saved in your account but not attached to any Space. - Connecting (
connecting) — Binding has been dispatched to the gateway and the provider client is connecting. - Ready (
ready) — Connected and receiving/sending messages. - Degraded (
degraded) — Connected with warnings or partial failures; hover or read the inline error message for details. - Error (
error) — Connection failed (reason codes includeinvalid_credentials,auth_failed,permission,network,rate_limit, andprovider_error). - Stopped (
stopped) — Provider client stopped.
Unbind or delete a channel
- To stop routing messages to a Space, click Unbind in Space Settings → Channels. Cohub removes the Space binding and disconnects the channel from the gateway.
- To delete a channel permanently, first unbind it from its Space, then open Account Settings → Channels and click Delete channel.
How external messages map to Space Chats, replies, and System labels
Conversation-to-Chat mapping
When an external message arrives on a bound channel, the gateway resolves a provider-specific binding key and maps that conversation to a dedicated Space Chat (spaceSessionBindings):
- Discord: Each server channel, thread, or DM maps to its own Space Chat. New Discord threads (
ThreadCreate) can pre-create a bound Chat automatically. - Feishu / Lark: Each chat (
chat_id) maps to a Space Chat; messages inside an explicit thread (thread_id) map to a separate Space Chat (feishu:conversation:<chatId>:<threadId>), and outbound replies stay in that thread. - WeChat: Each sender's direct conversation maps to its own Space Chat (
wechat:<accountId>:dm:<fromUserId>). - QQ Bot: Each C2C user conversation or QQ group maps to its own Space Chat.
Execution and reply details:
- Incoming turns run under the channel owner's Cohub account and require the owner to hold
session.prompt.fullaccesson the Space. - Duplicate provider message IDs are ignored via
providerMessageRefsdeduplication. - Model precedence for incoming turns is: per-conversation
/modelselection → bound channel default model → Space/platform default model. - Assistant replies and errors route back to the originating external chat (and thread/message reference when supported by the provider).
System labels
When Cohub creates a Space Chat from an external channel, it automatically attaches a read-only System label under the Space's root Channel label:
- Root System label:
Channel(systemKey: "session-channel:root") - Child System label:
Channel/<channelId>(systemKey: "session-channel:<channelId>",source: "system")
System labels let you filter Chats by originating channel in the Space sidebar. Because they are system-managed (source: "system"), users cannot rename, delete, reorder, or remove them from Chats.
In-chat slash commands
Users messaging the bot from an external platform can send built-in slash commands (directly, or after a leading bot mention):
| Command | Behavior |
|---|---|
/help |
Reply with the list of available commands and usage notes |
/new |
Start a new Space Chat for the current external conversation (assigns the same Channel/<channelId> System label and switches the conversation binding to the fresh Chat) |
/status |
Reply with the current Space Chat status, web link, and context token usage |
/model [provider/model_id] |
With no argument, list the current model and available non-hidden models; with provider/model_id, switch the model for the current conversation |
/models |
Alias for listing models via /model |
Boundaries & common errors
- One Space per channel (HTTP 409): A channel cannot be bound to two Spaces simultaneously (
channel is already bound to another space). Unbind it from the first Space before binding it to another. - Cannot delete a bound channel (HTTP 409): Deleting a channel while bound fails with
channel is bound to a space. Unbind it in Space Settings → Channels first. - Owner-only binding (HTTP 403): You can only bind channels owned by your own Cohub account (
channel not owned by you), and you must be a Spacehost(channel.manage). - Automatic unbind on member demotion or removal: If the channel owner is demoted to a lower Space role or removed from the Space, all of their channels bound to that Space are immediately unbound and disconnected from the gateway.
- Owner permission or billing blocks: If the channel owner no longer has
session.prompt.fullaccesson the Space, inbound messages are dropped. If execution is blocked by billing, Cohub sends a billing-blocked notice back to the external chat. - WeChat QR login expiry and verification limits:
- Each QR login session lasts 10 minutes (
QR code expired. Generate a new one.). - Entering too many incorrect 6-digit verification codes triggers
verify_code_blocked, ending the session so you must start again later. - WeChat channels cannot be created with manual credentials (
Create WeChat channels through the QR login flow.).
- Each QR login session lasts 10 minutes (
- Provider configuration pitfalls:
- Discord: Missing Message Content Intent or server permissions causes missing message text or failed replies; forgetting
@mentionin a server channel while Require @mention in Discord server channels is checked silently skips the message. - Feishu / Lark: Choosing
Feishufor an internationalLarkapp (or vice versa), not enabling Bot capability, not using Long Connection event subscriptions, or leaving the app unpublished causesauth_failedor missing events. - QQ Bot: Bots without QQ Open Platform WebSocket gateway access or without C2C/group message events enabled fail to connect or receive events.
- Discord: Missing Message Content Intent or server permissions causes missing message text or failed replies; forgetting
Next steps
- Members, invites & access — Understand
host/builder/guestpermissions, includingchannel.manageand automatic channel unbinding on demotion - Spaces — Manage Space settings, environment variables, and Sandbox configuration
- Chats — Filter Chats by System labels, inspect turns, fork conversations, and share sessions
- Product map — See where Channels fit alongside Spaces, Apps, Boards, and Local Runtime