wechatbot
δΈ­ζ–‡

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. CI

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.jsGo / Rust
Middlewareβœ“ Express-styleβ€” (handler composition)
StoragePluggable (file/memory/custom)File-based
EventsTyped EventEmitterCallbacks
Mediaβœ“ Upload + downloadβœ“ AES crypto
Dependencies0 runtimestdlib / reqwest+serde
Tests6932 / 38
PlatformsLinux, macOS, WindowsLinux, macOS, Windows
WeChatBot β€” Modular WeChat iLink Bot SDK