wechat-bot: Message Routing, Agent Replies and Local Chat Analysis
Purpose, mechanisms, getting started and boundaries
Source: wangrongding/wechat-bot · wangrongding
User Problem
Positioning and task fitDespite its name, wechat-bot now documents WeChat, Lark, Telegram and WhatsApp. It routes messages to models or Pi and provides a separate local-chat analysis path. Distinguish live automatic replies from historical analysis: their sources, triggers and data scope differ.
- Route selected messages to a model or Pi
- Restrict replies to selected contacts and groups
- Analyze chat records within an authorized scope
Product Mechanism
Capabilities and execution- Separate channels from reply servicesIncoming IM messages route to a configured service selected by command arguments, allowing a channel to remain while the reply backend changes. Source
- Allowlists control activationWeChat direct messages require an allowlisted contact; groups also require an allowed group and a mention. Non-text messages do not automatically enter the reply pipeline. Source
- Pi defaults to single-turn callsPi defaults to --print --no-session, so continuity across messages should not be assumed. Read integration guidance before changing session behavior. Source
- Separate live capture and local queriesLive WeChat messages can be captured as JSONL, while OpenCLI wx-cli accesses local history, members and Moments cache. Local statistics and model analysis are separate choices. Source
Workflow
Start with a small task- Select one channel and backendVerify the backend CLI or API first, then choose one IM channel. Add platforms gradually to keep routing failures diagnosable.
- Configure a narrow scopeConfigure bot name and allowlists from .env.example, keeping credentials local. Verify actual matching values because names can change.
- Start and test triggersStart the selected channel and test both an allowed message and one that should be ignored.
- Inspect retention and analysisInspect whether and where messages are stored before enabling AI analysis. Bound historical processing by date and conversation.
The trial sequence and checks are editorial guidance. Entry commands follow official documentation; this project was not executed for the article. Source
Official entry example
wb agent --im wechat --agent piComplete the prerequisites above first. Examples contain no real credentials.
Limits and Boundaries
Constraints and selection| Boundary | Meaning | Suggested action |
|---|---|---|
| WeChat protocol risk | The author warns that the default web protocol can trigger warnings or bans and notes maintenance limitations. Source | Evaluate within an acceptable scope without presenting the integration as guaranteed stable. |
| A message is not unrestricted authorization | Channel input reaches a model or agent whose tools determine possible effects. Source | Bound backend access and verify trigger restrictions. |
Scroll horizontally to view the full table
It suits developers studying message routing and scoped replies. Protocol limitations preclude treating it as a maintenance-free service.
How to Evaluate Adoption
Trial scenario and verificationStart with one contact and ordinary text replies, checking JSONL retention. Then run local statistics on one group and verify count and date scope. Send selected content to a model only when semantic analysis is needed.
Verify allowed replies, ignored disallowed messages, correct destination and configured retention.
Evidence: Pinned README · Current repository。
Source fetched (UTC): 2026-11-02T07:26:51.499Z;snapshot commit: 43c6c5075393。The source date denotes the repository snapshot commit, not the project’s original launch.