explaingit

wangrongding/wechat-bot

10,501JavaScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A WeChat chatbot that routes incoming messages to AI models like ChatGPT or DeepSeek and sends AI-generated replies back automatically, with support for whitelisting specific contacts or groups.

Mindmap

mindmap
  root((repo))
    What it Does
      Auto-replies on WeChat
      Routes to AI backends
      Whitelist filtering
    AI Backends
      ChatGPT
      DeepSeek
      Ollama local model
    Extra Features
      Group chat analysis
      Chat history query
      WeChat CLI tool
    Cautions
      Secondary account advised
      Unofficial protocol risk
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Connect your WeChat account to ChatGPT so messages from whitelisted contacts get automatic AI replies without any manual effort.

USE CASE 2

Run the bot with Ollama as the backend to answer WeChat messages using a locally hosted AI model, with no cloud API key required.

USE CASE 3

Analyze a WeChat group's conversation patterns by running the group chat analysis feature against your chat history.

USE CASE 4

Use the OpenCLI integration to search and query your WeChat contact list and message history from the command line.

Tech stack

JavaScriptNode.jsWechaty

Getting it running

Difficulty · moderate Time to first run · 30min

WeChat account suspension risk is real, the README strongly advises using a secondary account and keeping the whitelist narrow.

In plain English

This is a WeChat bot that connects your WeChat account to AI services so that incoming messages can be answered automatically. The README is written in Chinese. After scanning a QR code to log in, messages sent to the bot in private chats or group conversations are routed through an AI model of your choice, and the response is sent back through WeChat. The project is built on top of Wechaty, an existing library that provides a programmatic interface to WeChat. The bot supports a whitelist system, where only messages from contacts or groups whose names you specify in a configuration file will trigger AI replies. Messages that are not plain text, such as images or voice messages, are not processed by the reply pipeline. Several AI backends are supported. You can configure it to use ChatGPT, DeepSeek, Kimi, Doubao, Claude, Tongyi (Alibaba Cloud), Xunfei, Dify, Ollama (a local model runner), or the 302.AI aggregator. Each requires its own API key, which you add to a .env configuration file. Ollama is notable because it runs models locally on your own machine, so no external API key or internet connection to a cloud provider is needed for that option. Beyond automated replies, the tool also integrates with a separate project called OpenCLI, which allows you to query your local WeChat chat history, contact list, and group members from the command line. There is also a feature to analyze group chats or individual contacts using AI, generating a statistical or deep summary of conversation patterns. The README includes a warning that WeChat monitors and penalizes accounts that use unofficial web protocols, and advises using a secondary account and keeping the whitelist narrow to reduce the risk of account suspension.

Copy-paste prompts

Prompt 1
Set up wechat-bot with the DeepSeek backend. Walk me through creating the .env config file with the API key and setting a whitelist of contacts whose messages the bot should reply to.
Prompt 2
I want to run wechat-bot using Ollama locally so no messages are sent to external APIs. Show me the exact steps to configure it to use a local Llama model via Ollama.
Prompt 3
My wechat-bot is deployed and I want to generate an AI summary of a specific WeChat group's recent conversations. How do I use the group chat analysis feature?
Prompt 4
Explain the account suspension risk of using wechat-bot and what the README recommends to minimize it. What should I do before running it on my main WeChat account?
Prompt 5
Walk me through scanning the QR code to log in with wechat-bot and verifying that it is connected and receiving messages correctly.
Open on GitHub → Explain another repo

← wangrongding on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.