Meet NanoCo, maintainers of NanoClaw: we raised $12M to give every member of your team a professional assistant →
Skills
Messaging Official

WeChat

Add WeChat as a messaging channel via Tencent's official iLink Bot API. QR-scan login, no PadLocal token, no ban risk.

What it does

  • First-party Tencent API — no ToS violation, no ban risk
  • Free — no PadLocal or paid token required
  • Long-poll connection — no public webhook URL needed
  • QR scan login from your phone, like any other WeChat client
  • Personal contacts and group chats supported

What you'll need

  • NanoClaw installed and running
  • A personal WeChat account with the mobile app installed
  • A phone to scan the QR code on first login

Install

/add-wechat

How it works

The /add-wechat skill connects NanoClaw to WeChat via iLink Bot, Tencent’s first-party API for personal WeChat bots. This is distinct from WeChat Official Account or WeCom — it works with regular personal WeChat accounts.

iLink uses long-polling against Tencent’s servers, so NanoClaw doesn’t need a public webhook URL. There’s no PadLocal token, no monthly fee, and no ToS violation — Tencent built this API specifically for this use case.

Setup

The skill copies the WeChat adapter from the channels branch and installs wechat-ilink-client. There are no API keys to configure — auth is just a QR scan.

Enable the channel in .env:

WECHAT_ENABLED=true

Restart NanoClaw. The adapter prints a QR URL to logs/nanoclaw.log and saves it to data/wechat/qr.txt. Open the URL in a browser, then on your phone:

  1. Open WeChat
  2. Tap the + in the top-right → Scan
  3. Scan the QR
  4. Approve on your phone

NanoClaw saves the auth credentials to data/wechat/auth.json and connects.

Wire your first DM

A successful QR login alone isn’t enough — NanoClaw still needs to wire the inbound DMs to an agent. Have a different WeChat account send a message to the bot, then run:

pnpm exec tsx .claude/skills/add-wechat/scripts/wire-dm.ts

The script lists unwired WeChat messaging groups, asks which agent group to wire each one to, and writes the messaging_group_agents row with sensible defaults — request_approval sender policy and shared session mode.

What you get

  • Contacts and group chats — both modeled as messaging groups.
  • Markdown formatting preserved as best WeChat allows.
  • Approval flow for unknown senders. The first DM from a new contact triggers an admin approval card; once approved, follow-up messages route to the agent normally.
  • Long-poll resilience — the adapter reconnects automatically and persists its sync cursor at data/wechat/sync-buf.txt.

Tips

  • Only one instance can use a given auth.json at a time. Don’t run two NanoClaw installs pointing at the same file.
  • If WeChat shows “session expired” in logs, delete data/wechat/auth.json and restart — you’ll be prompted to re-scan.
  • WeChat platform IDs are wechat:<wxid> for contacts and wechat:<group_id> for rooms. The first inbound message creates the messaging group automatically.
  • Don’t commit data/wechat/auth.json. It’s gitignored by default but worth double-checking.
  • data/wechat/sync-buf.txt is the long-poll cursor. Don’t delete it in normal operation — deleting it replays recent history on next start.