Wechaty is a conversational RPA SDK that simplifies the process of building chatbots. It’s like a Swiss Army knife for chatbot development, providing a universal interface to various messaging platforms such as WhatsApp, WeChat, and more. With Wechaty, you write your bot code once, and it runs on any of the supported platforms. This means you can focus on creating engaging conversational experiences without worrying about the underlying complexities of each platform’s API. It’s open-source, easy to use, and backed by a vibrant community that’s ready to help you bring your chatbot ideas to life.
Connecting Chatbots
Wechaty is an RPA (Robotic Process Automation) SDK for Chatbot Makers which can help you create a bot in 6 lines of JavaScript, Python, Go, and Java, with cross-platform support including Linux, Windows, MacOS, and Docker.
Wechaty is used in many ChatBot projects by thousands of developers. To talk with other developers, scan the QR Code below and join our Wechaty Developer Community.
Scan now because other Wechaty developers want to talk with you, too!
Resource
Wechaty has already held lots of talks and got a lot of blogs in the past years; here are all of the wechaty resources:
We have a Wechaty starter repository for beginners with the simplest setting. It will be work out-of-the-box after you clone & npm install & npm start.
If you are new to Wechaty and want to try it the first time, we’d like to strong recommend you starting from this repository, and using it as your starter template for your project.
Otherwise, please saved the above The World’s Shortest ChatBot Code: 6 lines of JavaScript example to a file named bot.js before you can use either NPM or Docker to run it.
1. Npm
npm init
npm install wechaty
# create your first bot.js file, you can copy/paste from the above "The World's Shortest ChatBot Code: 6 lines of JavaScript"
# then:
node bot.js
Wechaty Docker supports both JavaScript and TypeScript. To use TypeScript just write in TypeScript and save with extension name .ts, no need to compile because we use ts-node to run it.
2.1. Run JavaScript
# for JavaScript
docker run -ti --rm --volume="$(pwd)":/bot wechaty/wechaty bot.js
2.2. Run TypeScript
# for TypeScript
docker run -ti --rm --volume="$(pwd)":/bot wechaty/wechaty bot.ts
Wechaty is very powerful that it can run over different protocols. You can specify the protocol by set the environment variable WECHATY_PUPPET to different puppet provider.
Send text,media file, contact card, or text with mention @mention contact inside Room, return the message which the bot sent (only puppet-padplus supported).
Wechaty is fully automatically tested by unit and integration tests, with Continuous Integration & Continuous Delivery (CI/CD) support powered by CI like Travis, Shippable and Appveyor.
Creating and publishing a Wechaty Plugin is simple. Simply expose your module as a function that takes 1 parameter: wechaty. When your plugin is imported by Wechaty, it will pass itself in as the argument, and so you are free to add any configuration that Wechaty supports.
The config exist so the user can pass in customizations to your Plugin. In documenting your Wechaty Plugin, you would lay out your supported config for the user.
The best practice for running Wechaty Docker/NPM is using a VPS(Virtual Private Server) outside of China, which can save you hours of time because npm install and docker pull will run smoothly without any problem.
The following VPS providers are used by the Wechaty team, and they worked perfectly in production. You can use the following link to get one in minutes. Also, doing this can support Wechaty because you are referred by us.
Huan’s daily life/work depends on too much chat on wechat.
Almost 14,000 wechat friends in May 2014, before wechat restricts a total number of friends to 5,000.
Almost 400 wechat rooms, and most of them have more than 400 members.
Can you imagine that? He was dying…
So a tireless bot working for me 24x7 on wechat, monitoring/filtering the most important message is badly needed. For example, it highlights discussion which contains the KEYWORDS which he want to follow up(especially in a noisy room). ;-)
At last, It’s built for huan’s personal study purpose of Automatically Testing.
Stargazers over time
Contributors
This project exists thanks to all the people who contribute. [Contribute].
Huan(LinkedIn), 🐧 Tencent TVP of Chatbot・🤖 Chatie Architect・⭐️ GitHub Star・🚀 YC W19・🌐 Microsoft RD & AI MVP・🦾 Google ML GDE ・🤠 Serial Entrepreneur・🔥 Burner
Rui (李佳芮), Microsoft AI MVP & RD, Co-founder & CEO of Juzi.BOT (YC W19 Alumni)
Cite Wechaty
To cite this project in publications:
@misc{Wechaty,
author = {Huan Li, Rui Li},
title = {Wechaty: Conversational SDK for Chatbot Makers},
year = {2016},
publisher = {GitHub},
journal = {GitHub Repository},
howpublished = {\url{https://github.com/wechaty/wechaty}},
}
Wechaty

Ship.Fail PreAngel

Elevator Pitch
Wechaty is a conversational RPA SDK that simplifies the process of building chatbots. It’s like a Swiss Army knife for chatbot development, providing a universal interface to various messaging platforms such as WhatsApp, WeChat, and more. With Wechaty, you write your bot code once, and it runs on any of the supported platforms. This means you can focus on creating engaging conversational experiences without worrying about the underlying complexities of each platform’s API. It’s open-source, easy to use, and backed by a vibrant community that’s ready to help you bring your chatbot ideas to life.
Connecting Chatbots
Wechaty is an RPA (Robotic Process Automation) SDK for Chatbot Makers which can help you create a bot in 6 lines of JavaScript, Python, Go, and Java, with cross-platform support including Linux, Windows, MacOS, and Docker.
:spider_web: https://wechaty.js.org
https://github.com/Wechaty/wechaty
https://github.com/Wechaty/wechaty/issues
https://github.com/Wechaty/wechaty-getting-started
🐳 https://hub.docker.com/r/wechaty/wechaty
Breaking News
Voice of Developers
See more at Wiki:Voice Of Developer
Join Us on Discord
Wechaty is used in many ChatBot projects by thousands of developers. To talk with other developers, scan the QR Code below and join our Wechaty Developer Community.
Scan now because other Wechaty developers want to talk with you, too!
Resource
Wechaty has already held lots of talks and got a lot of blogs in the past years; here are all of the wechaty resources:
🚀 The World’s Shortest ChatBot Code: 6 lines of JavaScript
This bot can log all messages to the console after login by the scan.
You can find Wechaty’s Official Examples at examples/ding-dong-bot.ts and more from our Example Directory.
Getting Started
We have a Wechaty starter repository for beginners with the simplest setting. It will be work out-of-the-box after you
clone&npm install&npm start.If you are new to Wechaty and want to try it the first time, we’d like to strong recommend you starting from this repository, and using it as your starter template for your project.
Otherwise, please saved the above The World’s Shortest ChatBot Code: 6 lines of JavaScript example to a file named
bot.jsbefore you can use either NPM or Docker to run it.1. Npm
2. Docker
2.1. Run JavaScript
2.2. Run TypeScript
3. Switch Protocol(Puppet)
Wechaty is very powerful that it can run over different protocols. You can specify the protocol by set the environment variable
WECHATY_PUPPETto different puppet provider.If you cannot use Web protocol, you can apply other protocols following the instruction here: https://github.com/wechaty/wechaty/wiki/Support-Developers We provide free token to support developers build a valuable WeChat chatbot.
Currently we support the following puppet providers :
export WECHATY_PUPPET=wechaty-puppet-puppeteerexport WECHATY_PUPPET=wechaty-puppet-serviceexport WECHATY_PUPPET=wechaty-puppet-mockexport WECHATY_PUPPET=wechaty-puppet-wechat4uexport WECHATY_PUPPET=wechaty-puppet-serviceexport WECHATY_PUPPET=wechaty-puppet-serviceexport WECHATY_PUPPET=wechaty-puppet-servicePuppetPadproDEPRECATEDexport WECHATY_PUPPET=wechaty-puppet-padproPuppetPadchatDEPRECATEDexport WECHATY_PUPPET=wechaty-puppet-padchatPuppetPadplusDEPRECATEDexport WECHATY_PUPPET=wechaty-puppet-padplusPuppetMacproDEPRECATEDexport WECHATY_PUPPET=wechaty-puppet-macproPuppetWxworkDEPRECATEDexport WECHATY_PUPPET=wechaty-puppet-serviceLearn more about Wechaty Puppet from the Puppet Wiki:
Read the Full Documentation at Wechaty Official API Reference
1 Class
WechatyMain bot class.
A
Botis a Wechaty instance that control a specific wechaty-puppet.new Wechaty(options?: WechatyOptions)options.name?: stringthe name of this bot(optional)options.puppet?: stringselect which puppet provider we want to use. must be one of the:options.puppetOptions?: PuppetOptionsoptions for the puppet provider.loginlogoutfriendshipmessageroom-joinroom-topicroom-leaveroom-invitescanstart(): Promise<void>stop(): Promise<void>logonoff(): booleanlogout(): Promise<void>currentUser(): ContactSelfsay(text: string): Promise<void>textto itself2 Class
ContactAll wechat contacts(friends/non-friends) will be encapsulated as a Contact.
find(query: string): Promise<null | Contact>findAll(query: string): Promise<Contact[]>nameoraliasload(query: string): Contactid: readonly stringsync(): Promise<void>say(text: string): Promise<void | Message>puppet-padplussupported).self(): booleanname(): stringalias(): Promise<string>alias(newAlias: string): Promise<void>friend(): booleantype(): ContactTypeprovince(): stringcity(): stringavatar(): Promise<FileBox>gender(): ContactGender2.1 Class
ContactSelfClass
ContactSelfis extended fromContact.avatar(file: FileBox): Promise<void>qrcode(): Promise<string>signature(text: string): Promise<void>2.2 Class
FriendshipSend, receive friend request, and friend confirmation events.
add(contact: Contact, hello?: string): Promise<void>accept(): Promise<void>hello(): stringcontact(): Contacttype(): FriendshipType3 Class
MessageAll wechat messages will be encapsulated as a Message.
find(query: string): Promise<null | Message>findAll(query: string): Promise<Message[]>from(): Contactto(): Contactroom(): null | Roomnull)text(): stringsay(text: string): Promise<void | Message>puppet-padplussupported).type(): MessageTypeself(): booleanmention(): Contact[]mentionSelf(): booleanforward(to: Contact): Promise<void>age(): numberdate(): DatetoFileBox(): Promise<FileBox>toContact(): Promise<Contact>4 Class
RoomAll wechat rooms(groups) will be encapsulated as a Room.
create(contactList: Contact[], topic?: string): Promise<Room>find(query: string): Promise<null | Room>findAll(query: string): Promise<Room[]>load(query: string): Roomid: readonly stringjointopicleaveinvitesync(): <Promise<void>say(text: string): Promise<void | Message>puppet-padplussupported).add(contact: Contact): Promise<void>del(contact: Contact): Promise<void>quit(): Promise<void>topic(): Promise<string>topic(newTopic: string): Promise<void>announce(text: string): Promise<void>qrcode(): Promise<string>alias(contact: Contact): Promise<string>roomAlias(contact: Contact): Promise<string | null>has(contact: Contact): Promise<boolean>contactmemberAll(query?: string): Promise<Contact[]>member(query: string): Promise<null | Contact>memberList():Promise<Contact[]>owner(): null | Contact4.1 Class
RoomInvitationAccept room invitation
accept(): Promise<void>inviter(): ContactroomTopic(): Promise<string>date(): Promise<Date>age(): Promise<number>TEST
Wechaty is fully automatically tested by unit and integration tests, with Continuous Integration & Continuous Delivery (CI/CD) support powered by CI like Travis, Shippable and Appveyor.
To test Wechaty, run:
Get to know more about the tests from Wiki:Tests
CREATING WECHATY PLUGIN
Creating and publishing a Wechaty Plugin is simple. Simply expose your module as a function that takes 1 parameter: wechaty. When your plugin is imported by Wechaty, it will pass itself in as the argument, and so you are free to add any configuration that Wechaty supports.
The
configexist so the user can pass in customizations to your Plugin. In documenting your Wechaty Plugin, you would lay out your supported config for the user.See:
📝 RELEASE NOTES
✨ Wechaty Badge
Get more embed html/markdown code from Wiki:Badge
Pull Request is welcome to add yours!
Learn more about Projects Using Wechaty at Wiki:Projects Using Wechaty
The best practice for running Wechaty Docker/NPM is using a VPS(Virtual Private Server) outside of China, which can save you hours of time because
npm installanddocker pullwill run smoothly without any problem.The following VPS providers are used by the Wechaty team, and they worked perfectly in production. You can use the following link to get one in minutes. Also, doing this can support Wechaty because you are referred by us.
💩 The Story
In 2017 …
Huan’s daily life/work depends on too much chat on wechat.
Can you imagine that? He was dying…
So a tireless bot working for me 24x7 on wechat, monitoring/filtering the most important message is badly needed. For example, it highlights discussion which contains the KEYWORDS which he want to follow up(especially in a noisy room). ;-)
At last, It’s built for huan’s personal study purpose of Automatically Testing.
Stargazers over time
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Multi-language Wechaty
History
main v1.11 (Nov 22, 2021)
Working on reduxify the Wechaty ecosystem for applying the CQRS pattern.
v1.10 (Nov 21, 2021)
Second beta release of Wechaty, with all ecosystem npm modules with version v1.10 (wechaty-puppet, wechaty-puppet-service, etc)
v1.0 (Sep 2021)
v0.69
v0.68 (Aug 27, 2021)
Creators
Cite Wechaty
To cite this project in publications:
Copyright & License