Scripts2026年7月27日·1 分钟阅读

Wechaty — Conversational RPA SDK for Chatbot Makers

Open-source SDK for building chatbots across WeChat, WhatsApp, and other messaging platforms using a unified JavaScript/TypeScript API.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Stage only
信任
信任等级:Established
入口
Wechaty
安全暂存命令
npx -y tokrepo@latest install 07f0e43e-89bf-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

Introduction

Wechaty is an open-source conversational RPA SDK that lets developers build chatbots for WeChat, WhatsApp, Gitter, Lark, and other messaging platforms through a single, unified API. It abstracts away the protocol-level details of each platform so you can focus on conversation logic rather than transport plumbing.

What Wechaty Does

  • Provides a universal chatbot API across 10+ messaging platforms
  • Handles contact management, room (group) operations, and friendship events
  • Supports sending and receiving text, images, files, links, and mini-programs
  • Offers a puppet architecture that swaps platform connectors without changing bot code
  • Ships SDKs in TypeScript, Python, Go, Java, .NET, PHP, and Scala

Architecture Overview

Wechaty follows a puppet-provider pattern. The core SDK defines a high-level Wechaty class that emits events (message, login, friendship, room-join). Under the hood, a Puppet abstraction delegates to a concrete PuppetProvider (e.g., PadLocal for iPad protocol, WhatsApp Web, or Gitter). Providers can run in-process or as a gRPC remote service, which means a Python bot can drive a TypeScript puppet over the network.

Self-Hosting & Configuration

  • Install via npm: npm install wechaty
  • Choose a puppet provider: WECHATY_PUPPET=wechaty-puppet-padlocal
  • Set the puppet token as an env var: WECHATY_TOKEN=your_token
  • For WhatsApp, use the free whatsapp-web puppet with no token required
  • Deploy as a Docker container for headless server-side bots

Key Features

  • Multi-platform: one codebase, many chat networks
  • Event-driven API with async/await support throughout
  • Polyglot SDKs sharing the same puppet service via gRPC
  • Plugin system for middleware such as QR-code generation, message filtering, and auto-reply
  • Active community with 200+ contributors and 100+ published plugins

Comparison with Similar Tools

  • Botpress — visual flow builder with broader NLU; Wechaty is code-first with wider IM coverage
  • Rasa — focuses on NLU/dialogue management; Wechaty focuses on platform connectivity
  • node-telegram-bot-api — Telegram-only; Wechaty covers multiple platforms in one SDK
  • whatsapp-web.js — WhatsApp-only reverse-engineered client; Wechaty wraps it as one puppet among many
  • Hubot — GitHub's classic bot framework; Wechaty provides richer IM-specific primitives

FAQ

Q: Is Wechaty free to use? A: The SDK itself is open-source under Apache-2.0. Some puppet providers (like PadLocal for WeChat) require a paid token, while others (WhatsApp Web) are free.

Q: Can I run a single bot on multiple platforms simultaneously? A: Yes. Instantiate multiple Wechaty instances with different puppet providers, and share your message handler logic across them.

Q: Which programming languages does Wechaty support? A: TypeScript/JavaScript is the primary SDK. Official polyglot SDKs exist for Python, Go, Java, .NET, PHP, Scala, and Rust, all communicating with puppets via gRPC.

Q: Does Wechaty work in China behind the GFW? A: Yes. WeChat puppets run domestically, and WhatsApp puppets can connect through standard proxies if needed.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产