TokenFlux Docs

Channels

Talk to an agent from Telegram, WeChat, Feishu and Slack

Channels let you talk to an agent from the chat apps you already use. Open Agents, select an agent, then select Manage and Channels.

Each bot or app belongs to you and serves one agent. An agent can connect one account per platform. TokenFlux stores the tokens and secrets for that agent only. It never shows them again and never passes them into the sandbox.

PlatformHow to connectChats
TelegramCreate a bot in Telegram, or paste a bot tokenPrivate chats, groups and topics
WeChatScan a QR code with WeChatPrivate chats only
FeishuScan a QR code, or enter an App ID and secretPrivate chats, groups and topics
SlackPaste an app-level token and a bot tokenDirect messages and channels

How a chat works

Link a chat first. A chat that is not linked cannot use the agent. To link a chat, select Create link or Create code on the Channels page, then follow the instructions it shows. A link or code works once and expires in 10 minutes.

One chat, one conversation. A linked chat has its own conversation with the agent. The chat's first message creates the conversation, and it appears under Conversations in the web app. /new makes the next message start another conversation. Linking the chat again also starts a new conversation.

Group access. By default, only the person who linked the chat can run the agent. It ignores other people. The person who linked the whole group can send /members on in that group to open it to every member, or /members off to allow only the person who linked it again. This command cannot change access from a topic.

With /members on, every task is billed to the owner. Anyone in the group gets full control of the agent: its workspace, its API key, its automations and its memory. Use this only on a TokenFlux account set up for this team. /members off stops new requests from others; it does not undo anything already done. Requests already accepted still run.

In groups, the agent reads messages that mention or reply to it. Topic follow works only in Feishu and Slack. When a top-level message mentions the bot and starts a topic, that topic follows by default when the platform permits it. Later messages from authorized users can start paid tasks without a mention. Send /follow off in the topic to require mentions again. To turn follow back on, send @bot /follow on. A plain /follow on is ignored while follow is off. Follow does not change who can use the agent. Requests already accepted still run. Telegram does not support /follow.

Replies. While a task runs, the chat shows that the agent is working. The reply streams in with each platform's own method:

  • Telegram: a draft in a private chat, and a message edited in place in a group. The final answer is sent as new messages.
  • Feishu: a card that fills in as the reply grows and becomes the answer.
  • Slack: a streamed message that becomes the answer.
  • WeChat: a typing indicator, then the final answer.

Long answers are split into several messages. In Telegram and WeChat, a very long answer is shortened and points to the full result in the web app.

Steering. A message sent while the chat's task runs steers that task.

Text only. Chat apps send text to the agent. Images and files in a chat are not read. Use the web app to send images.

Start, stop, replace and disconnect. Stop keeps the account and its linked chats, but the agent ignores messages until you start it again. Replacing the account or disconnecting it unlinks all its chats. Unlink removes one chat. Deleting the agent disconnects all its channels.

Chat commands

Send these commands in a linked chat. In Slack, mention the bot first, for example @bot /new, because Slack handles messages that start with /.

CommandWhat it does
/newThe next message starts a new conversation.
/stopStops the task of this chat's conversation. Tasks from the web app keep running.
/compactCompresses this conversation's context. It can spend model tokens.
/model [ID]Shows the available models, or sets the model of this conversation.
/thinking [level]Shows or sets the thinking level of this conversation.
/sessionShows the conversation's usage.
/members [on|off]In the whole group, the person who linked it sets who can use the agent.
/follow [on|off]Feishu and Slack topics only. After off, send @bot /follow on to turn it back on.
/helpLists the commands.

Model and thinking changes apply from the next message.

Telegram

Create a bot. If the Channels page shows Create bot, open the link on the device where you use Telegram. Select Create bot in Telegram and confirm. Telegram creates a bot that you own, TokenFlux connects it, and your private chat is linked automatically. You do not need to paste a token or create a link for this private chat. Send the bot a message to start.

Use a bot token. To use a bot you already have, select Already have a bot? Use its token. The page shows the token form directly when Create bot is not available.

  1. In Telegram, open @BotFather.
  2. Send /newbot and choose a name. BotFather replies with a token.
  3. Paste the token and select Connect and start.

The bot must not have a webhook and must not serve another agent.

Link a chat. For the token path, select Create link, open the link or scan its QR code, then press Start in Telegram to link the private chat. The auto-create path has already linked the private chat. To link a group, select Add @bot to a group and choose the group.

  • In a forum group, each new topic gets its own conversation.
  • Converting a group to a supergroup changes its chat ID. Link it again.
  • Disconnecting a bot does not delete it in Telegram.

WeChat

  1. Select Show QR code.
  2. Scan it with WeChat on your phone, not with the camera app, and confirm.
  3. Your private chat is linked. Send the bot a message to start.

WeChat can deliver a bot message only after you send the bot a message. Until then, the chat shows Cannot receive messages yet. To link another WeChat chat, select Create code and send link CODE to the bot. To reconnect after an error, select Scan again.

Feishu

Scan a QR code.

  1. Select Show QR code.
  2. Scan it with Feishu on your phone. Create a new app or choose one of yours.
  3. The app connects and greets you in a private chat. Reply there to start.

Enter an App ID and App Secret. Select Enter an App ID and App Secret instead.

  1. In the Feishu Open Platform, create a custom app and add the bot capability.
  2. Grant these tenant permissions for basic chat use: im:chat, im:message, im:message.group_at_msg:readonly, im:message.p2p_msg:readonly and cardkit:card:write. These permissions let the app read chat details, send messages, receive private messages and group mentions, and create or update cards for streamed replies.
  3. To use topic follow, also grant im:message.group_msg. It lets the app read topic history and receive topic replies without a mention. A tenant admin must approve this permission. Basic chat use does not require it.
  4. Set event delivery to a long connection and subscribe to im.message.receive_v1.
  5. Paste the App ID and App Secret and select Connect and start.

Link a chat. Select Create code. Send link CODE to the bot in a private chat, or mention the bot with link CODE in a group. In a group, the agent answers messages that mention or reply to it. In topics that follow, it can also answer authorized users without a mention.

Slack

Slack connects through a Socket Mode app that you create in your workspace.

  1. Create an app from scratch at api.slack.com/apps.
  2. Turn on Socket Mode and create an app-level token (xapp-) with the connections:write scope.
  3. Add these bot token scopes: chat:write, reactions:write, users:read, channels:read, groups:read, im:read, channels:history, groups:history and im:history.
  4. Subscribe to the bot events message.channels, message.groups and message.im, then install the app.
  5. Paste the app-level token and the bot token (xoxb-) and select Connect and start.

Link a chat. Select Create code. Send link CODE to the bot in a direct message, or post it in a channel that the bot is in. Linking a channel links the whole channel. In a channel, each top-level message that mentions the bot starts a thread with its own conversation.

If the Channels page shows an error, the platform rejected the token or the app. Fix it on the platform, then select Start again or replace the credentials.

On this page