A modular, extensible WeChat iLink Bot SDK β available in Node.js, Python, Go, and Rust. Plus a Pi coding agent extension that lets you chat with Pi from WeChat. Cross-platform: tested on Linux, macOS, and Windows. GitHub.
Scan QR in WeChat β Chat with Pi coding agent
Quick start
npm install @wechatbot/wechatbot
import { WeChatBot } from '@wechatbot/wechatbot' const bot = new WeChatBot() await bot.login() // Shows QR code β scan in WeChat bot.onMessage(async (msg) => { await bot.sendTyping(msg.userId) await bot.reply(msg, `Echo: ${msg.text}`) }) await bot.start()
Scan the QR code in WeChat β your bot is live. Credentials auto-saved, session auto-recovered.
SDKs
Choose your language. All SDKs share the same architecture and capabilities.
π‘
Protocol Reference
iLink Bot API spec with sequence diagrams. QR login, message loop, CDN crypto.
π’
Node.js SDK
TypeScript-first, unified send/download API, full media support, 69 tests. Zero runtime deps.
π
Python SDK
Async/aiohttp, decorator handlers, dataclass types, 17 tests. Clean Pythonic API.
π΅
Go SDK
Goroutine-safe, stdlib only, AES-128-ECB crypto, 32 tests. Clean idiomatic Go.
π¦
Rust SDK
Async/tokio, serde types, thiserror errors, 38 tests. Type-safe and zero-copy.
π€
Pi Agent
Pi extension β scan QR in WeChat, chat with Pi from your phone. Text, images, files, voice.
Architecture
All SDKs follow the same layered design:
graph TD A["π€ Your Bot Code"] --> B["Bot Client (Orchestrator)"] B --> C["Poller"] B --> D["Sender"] B --> E["Typing"] B --> F["Media"] C --> G["Context Store (Token Cache)"] D --> G E --> G F --> G G --> H["Protocol / API (HTTP Calls)"] H --> I["Storage (Credentials + State)"]
Shared capabilities: QR login, long-poll, context_token management, AES-128-ECB CDN crypto, session recovery, smart text chunking.
SDK comparison
| Node.js | Go / Rust | |
|---|---|---|
| Middleware | β Express-style | β (handler composition) |
| Storage | Pluggable (file/memory/custom) | File-based |
| Events | Typed EventEmitter | Callbacks |
| Media | β Upload + download | β AES crypto |
| Dependencies | 0 runtime | stdlib / reqwest+serde |
| Tests | 69 | 32 / 38 |
| Platforms | Linux, macOS, Windows | Linux, macOS, Windows |