Skip to content

Connect DotCraft to Weixin

Connect Weixin to DotCraft through Tencent iLink. The first login uses a QR code, and normal replies are sent as plain text.

Quick setup

  1. Confirm the Weixin account has Tencent iLink bot access.
  2. Open the target workspace in DotCraft Desktop.
  3. Open Channels, then select Weixin.
  4. Keep the default iLink API address unless Tencent gave you a different endpoint.
  5. Save the channel and turn it on.
  6. Scan the QR code shown in Desktop.
  7. Wait until Desktop shows the Weixin channel as connected.
  8. Send a message to the Weixin bot account.

Platform setup details

Weixin setup is authentication-first:

  1. Use the Weixin account that Tencent iLink authorizes for bot access.
  2. Keep Desktop open while the first QR login completes.
  3. Restarting Desktop normally reuses the saved session.
  4. Scan a new QR code when Desktop asks you to re-authenticate.

No public callback URL is required for the Desktop-managed Weixin channel.

Test the connection

  1. Send hello to the Weixin bot account.
  2. Confirm DotCraft replies in the same chat.
  3. Send /new, then send another message and confirm it starts a fresh conversation.
  4. Ask DotCraft to do something that needs approval and reply with an approval keyword.
  5. Send a task that returns a file or image if your workflow depends on media delivery.

What works after setup

  • /new starts a fresh DotCraft conversation in the current Weixin chat.
  • The login session is saved for normal restarts.
  • If the session expires, Desktop shows a new QR code.
  • Regular replies and media captions are flattened to plain text because iLink does not expose Markdown rendering.
  • File and image delivery are available through channel delivery tools.
  • Approval replies accept plain chat keywords such as 同意, 允许, yes, approve, and reject.

Standalone adapter

Run the Weixin adapter yourself only when Desktop is not managing the channel process.

bash
cd sdk/typescript
npm run build --workspace @dotcraft/channel-weixin
npx dotcraft-channel-weixin --workspace /path/to/workspace

Use --config /custom/weixin.json when the adapter config is not stored at .craft/weixin.json. In terminal mode, the QR code is rendered in the terminal.

Register the channel as a standalone WebSocket adapter in the shared channel configuration reference.

Reference

See Channel configuration reference for the Weixin JSON example, ExternalChannels registration, and field table.