Connect IM Channel Bots
Connect the current Agent to an IM platform so it can receive and send messages in the target app.
Read The Right Reference
After confirming which channel the user wants, read the matching reference file for credentials and exact steps:
- WeChat (official ClawBot) -> reference/wechat.md
- WeCom -> reference/wecom.md
- DingTalk -> reference/dingtalk.md
- Lark -> reference/lark.md
WeChat and WeCom are completely separate platforms. Do not mix them up. WeChat uses QR authorization and does not requirebot_idorsecret.
Default Flow
- Confirm the channel: If the user did not specify one, ask which IM platform they want: WeChat, WeCom, DingTalk, or Lark.
- Read the reference: Load the matching channel reference file.
- Collect credentials: Follow the instructions in that reference. WeChat does not need credentials because it uses QR authorization.
- Establish the connection: Run the
run_skills_snippetcode from the reference. - Report the result: If the connection succeeds, tell the user what to do next. If it fails, return the error and guide the next step.
Notes
- After a connection is established, it keeps running in the background. Credentials are saved to
.magic/config/im-channels.jsonand bound to the current sandbox. Restarting the same sandbox process should auto-reconnect without asking for setup again. - To disable auto-reconnect for a channel, edit
.magic/config/im-channels.jsonand set that channel'senabledfield tofalse. - All channels share the same Agent as the web session, so conversation history stays connected across surfaces.
- For WeChat, do not generate your own QR layout. Always use the mobile-width HTML template from the WeChat reference and paste the exact
{{QRCODE_JS_STRING_LITERAL}}value returned by the tool. - For WeChat, output the QR as exactly one
htmlfenced code block. Do not add extra prose before or after the block.