Zero-dependency Python SDK for WeChat bots (iLink): text, image, video and MCP server.
10K+
Lightweight Python SDK for the WeChat iLink Bot protocol.
login() / send() / recv()context_token and sync cursor handled internallyweilink command with admin and mcp subcommandspip install weilink[mcp])pip install weilink
from weilink import WeiLink
wl = WeiLink()
wl.login()
# Receive messages
messages = wl.recv()
for msg in messages:
print(f"{msg.from_user}: {msg.text}")
# Reply
wl.send(msg.from_user, "Got it!")
wl.close()
WeiLink wraps the WeChat iLink Bot protocol (the underlying protocol of the ClawBot plugin), exposing a message-queue-style interface:
login() → QR scan to obtain credentials (persisted)
recv() → Long-poll for messages (35s timeout)
send() → Reply to a user (context_token auto-attached)
A built-in web UI for session management, QR login, and status monitoring:
pip install weilink[server]
weilink admin -p 8080
| Method | Description |
|---|---|
login(force=False) | QR code login, reuses existing credentials |
recv(timeout=35.0) | Long-poll for incoming messages |
send(to, text, *, image, voice, file, video, file_name) | Send text and/or media (image/voice/file/video), returns bool |
download(msg) | Download media from a received message |
send_typing(to) | Show "typing" indicator |
stop_typing(to) | Cancel "typing" indicator |
close() | Save state and clean up |
is_connected | Whether logged in (property) |
bot_id | Current bot ID (property) |
Feel free to discuss the project via GitHub Issues or the LINUX DO community.
Content type
Image
Digest
sha256:b19d29180…
Size
17.6 MB
Last updated
7 months ago
docker pull oaklight/weilink