



















@@ -0,0 +1,145 @@
1+---
2+summary: "Move one OpenClaw session's reply route between linked chat channels"
3+title: "Channel docking"
4+read_when:
5+ - You want replies for one active session to move from Telegram to Discord, Slack, Mattermost, or another linked channel
6+ - You are configuring session.identityLinks for cross-channel direct messages
7+ - A /dock command says the sender is not linked or no active session exists
8+---
9+10+Channel docking is call forwarding for one OpenClaw session.
11+12+It keeps the same conversation context, but changes where future replies for
13+that session are delivered.
14+15+## Example
16+17+Alice can message OpenClaw on Telegram and Discord:
18+19+```json5
20+{
21+ session: {
22+ identityLinks: {
23+ alice: ["telegram:123", "discord:456"],
24+ },
25+ },
26+}
27+```
28+29+If Alice sends this from Telegram:
30+31+```text
32+/dock_discord
33+```
34+35+OpenClaw keeps the current session context and changes the reply route:
36+37+| Before docking | After `/dock_discord` |
38+| ---------------------------- | --------------------------- |
39+| Replies go to Telegram `123` | Replies go to Discord `456` |
40+41+The session is not recreated. The transcript history stays attached to the
42+same session.
43+44+## Why use it
45+46+Use docking when a task starts in one chat app but the next replies should land
47+somewhere else.
48+49+Common flow:
50+51+1. Start an agent task from Telegram.
52+2. Move to Discord where you are coordinating work.
53+3. Send `/dock_discord` from the Telegram session.
54+4. Keep the same OpenClaw session, but receive future replies in Discord.
55+56+## Required config
57+58+Docking requires `session.identityLinks`. The source sender and target peer
59+must be in the same identity group:
60+61+```json5
62+{
63+ session: {
64+ identityLinks: {
65+ alice: ["telegram:123", "discord:456", "slack:U123"],
66+ },
67+ },
68+}
69+```
70+71+The values are channel-prefixed peer ids:
72+73+| Value | Meaning |
74+| -------------- | ---------------------------- |
75+| `telegram:123` | Telegram sender id `123` |
76+| `discord:456` | Discord direct peer id `456` |
77+| `slack:U123` | Slack user id `U123` |
78+79+The canonical key (`alice` above) is only the shared identity group name. Dock
80+commands use the channel-prefixed values to prove that the source sender and
81+target peer are the same person.
82+83+## Commands
84+85+Dock commands are generated from loaded channel plugins that support native
86+commands. Current bundled commands:
87+88+| Target channel | Command | Alias |
89+| -------------- | ------------------ | ------------------ |
90+| Discord | `/dock-discord` | `/dock_discord` |
91+| Mattermost | `/dock-mattermost` | `/dock_mattermost` |
92+| Slack | `/dock-slack` | `/dock_slack` |
93+| Telegram | `/dock-telegram` | `/dock_telegram` |
94+95+The underscore aliases are useful on native command surfaces such as Telegram.
96+97+## What changes
98+99+Docking updates the active session delivery fields:
100+101+| Session field | Example after `/dock_discord` |
102+| --------------- | ---------------------------------------- |
103+| `lastChannel` | `discord` |
104+| `lastTo` | `456` |
105+| `lastAccountId` | the target channel account, or `default` |
106+107+Those fields are persisted in the session store and used by later reply
108+delivery for that session.
109+110+## What does not change
111+112+Docking does not:
113+114+- create channel accounts
115+- connect a new Discord, Telegram, Slack, or Mattermost bot
116+- grant access to a user
117+- bypass channel allowlists or DM policies
118+- move transcript history to another session
119+- make unrelated users share a session
120+121+It only changes the delivery route for the current session.
122+123+## Troubleshooting
124+125+**The command says the sender is not linked.**
126+127+Add both the current sender and the target peer to the same
128+`session.identityLinks` group. For example, if Telegram sender `123` should dock
129+to Discord peer `456`, include both `telegram:123` and `discord:456`.
130+131+**The command says no active session exists.**
132+133+Dock from an existing direct-chat session. The command needs an active session
134+entry so it can persist the new route.
135+136+**Replies still go to the old channel.**
137+138+Check that the command replied with a success message, and confirm the target
139+peer id matches the id used by that channel. Docking only changes the active
140+session route; another session may still route elsewhere.
141+142+**I need to switch back.**
143+144+Send the matching command for the original channel, such as `/dock_telegram` or
145+`/dock-telegram`, from a linked sender.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。