Skip to content

wechat-bot

Open-source bot that connects WeChat, Lark, Telegram, or WhatsApp to AI models like ChatGPT, Claude, or DeepSe

Stars
11.5k
Forks
1.3k
Licence
MIT
Language
JavaScript
Last update
2 months ago
Type
App

What it is

This project is a bot that receives messages from chat apps (WeChat, Lark, Telegram, WhatsApp) and passes them to AI services such as ChatGPT, Claude, DeepSeek, or a local Ollama model, then sends the AI's reply back. It can also read local WeChat chats and contacts to run statistics or AI analysis on a group or a friend. It is built on the Wechaty library and requires you to configure your own API keys or local models.

  • Auto-reply to allowlisted WeChat private chats or group mentions using a chosen AI model
  • Run statistics or AI analysis on a specific WeChat group or friend using `wb analyze`
  • Send and read Lark, Telegram, or WhatsApp messages from the command line
  • Search local WeChat Moments cache using `wb wx sns-search`

Great for

  • Developers who want an AI auto-reply bot for a narrow set of WeChat friends or groups
  • Users who want to route Telegram or WhatsApp messages to an AI model they already pay for
  • People who run a local model with Ollama and want it answering chat messages
  • Anyone who wants to analyze activity in a group chat they belong to

Not ideal for

  • People who need a safe, officially supported WeChat integration: the README warns that WeChat Web protocols can trigger warnings or bans
  • Non-technical users, since setup involves editing a .env file and running terminal commands
  • Anyone who wants a polished consumer app with no configuration
Step-by-step guide: how to use wechat-botInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    You'll need: Node.js 18.0 or newer · npm · An API key for at least one AI service, or a local Ollama install

    Install dependencies

    npm i

    Create config file

    cp .env.example .env

    Link the wb command

    npm link
  2. 2

    Run it

    • Edit .env: set BOT_NAME, ALIAS_WHITELIST, ROOM_WHITELIST, and the Pi settings shown in the README
    • Run `wb agent --im wechat --agent pi`
    • Scan the QR code shown in the terminal with WeChat
    • Send a message from an allowlisted account to test replies
  3. 3

    Get the most out of it

    • Keep ALIAS_WHITELIST and ROOM_WHITELIST narrow to limit account risk and unwanted replies
    • Use `wb analyze --room` or `--friend` for AI analysis once a --serve provider is configured
    • Set WECHAT_STORE_MESSAGES to keep local JSONL message capture
    • Use Pi as the project agent with Lark, Telegram, or WhatsApp following the linked Pi Agent + IM guide
    • Use Ollama with OLLAMA_URL for a fully local model setup

Downloads

Strengths

  • Supports many AI providers, including OpenAI-compatible APIs and local Ollama
  • Covers several chat platforms (WeChat, Lark, Telegram, WhatsApp) under one command set
  • Uses an MIT license and has a large public user base on GitHub

Trade-offs

  • WeChat account risk: the README notes the default protocol can lead to warnings or bans, and the padlocal protocol is no longer maintained
  • Some AI services are paid; ChatGPT is described as a paid service requiring billing
  • Requires Node.js 18 or newer and manual .env configuration; the README is truncated and some features are described only briefly

How it compares

ProjectStarsTypeLevelUpdatedBest for
wechat-bot (this)11.5kAppintermediate2 months agoDevelopers who want an AI auto-reply bot for a narrow set of WeChat friends or groups
OpenHands92.5kAppintermediate4 days agoDevelopers who want coding agents running on a server while their laptop is off
codex-chatgpt-web15.4kAppintermediate6 days agoDevelopers who already pay for ChatGPT and want to use its web models inside Codex
langchain149kFrameworkintermediate4 days agoPython developers building LLM-powered applications
LibreChat46.6kAppintermediate4 days agoTeams that want one shared chat interface across several AI providers
one-api37.3kAppintermediate10 months agoDevelopers who want one OpenAI-compatible endpoint for several model providers

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.