Voice of the Developer
"The best wechat SDK I have seen in Github!" link
-- @JasLin, BotWave CTO
-- @shevyan, Ghost Cloud CEO
"Wechaty is great." link
-- @Samurais, SnapLingo Director of Engineering
-- @Jarvis, Baidu
"Wechaty library fantastic!" link - @ccaapton
"it's quite cool!" link - @ak5
"Thanks for great SDK" link - @naishstar
This bot can log all message to console.
You can find more example from Wiki and Example Directory.
We have two options to run wechaty:
The best practice to use Wechaty is run by docker, becasue it's not only the most easy way to get start, but also protect you out of the troubles of dependencies problems.
$ docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty mybot.js
Wechaty Docker support to run TypeScript directly as well: just write in TypeScript and save to
Get to know more about Wechaty Docker at Wiki:Docker.
Get to know more about NPM at Wiki:NPM
- scan Emit when the bot needs to show you a QR Code for scanning
- login Emit when bot login full successful.
- logout Emit when bot detected log out.
- message Emit when there's a new message.
- error Emit when there's an error occurred.
- friend Emit when got a new friend request, or friendship is confirmed.
- room-join Emit when someone join the room
- room-leave Emit when someone leave the room
- room-topic Emit when someone change the room's topic
- instance(setting: PuppetSetting): Promise<Wechaty> get the bot instance
- init(): Promise<void> Initialize the bot
- send(message: Message): Promise<void> send a message
- say(content: string): Promise<void> send message to filehelper, just for logging/reporting usage for your convenience
- from():Contact get the sender from a message
- from(contact:Contact):void set a sender to the message
- to():Contact get the destination of the message
- to(contact:Contact):void set the destination as contact for the message
- content():string get the content of the message
- content(content:string):string set the content for the message
- room():Room|null get the room from a message.
- room(room:Room):void set the room for a message.
- type():MsgType get the type of a Message.
- say(content:string):Promise reply a message to the sender.
- ready():Promise confirm get all the data needed, will be resolved when all message data is ready.
- self():boolean check if a message is sent by self
- name():string get name from a contact
- remark():string get remark name from a contact
- remark(remark:string):Promise set remark name to a contact
- weixin():string get weixin id from a contact
- star():boolean true for star friend, false for no star friend
- ready():Promise confirm get all the contact data needed, will be resolved when all data is ready
- say(content:string):Promise say content to a contact
- say(content:string,replyTo:Contact|ContactArray):Promise say content inside Room.
- ready():Promise confirm get all the data needed, will be resolved when all data is ready
- refresh():Promise reload data for Room
- join Emit when someone join the room
- leave Emit when someone leave the room
- topic Emit when someone change the room topic
- hello:string get content from friendrequest
- accept():void accept the friendrequest
- send(contact:Contact,hello:string):void send a new friend request
Wechaty use AVA for unit testing
To test Wechaty, run:
Get to know more about test from Wiki:Test
Powered By Wechaty
Get embed html/markdown code from Wiki:PoweredByWechaty
Projects Use Wechaty
- Wechaty.io ChatBot Portal Manager for Wechaty
Know more about Projects Use Wechaty at Wiki:PoweredByWechaty
Contributions in any form are highly encouraged and welcome! Be it new or improved presets, optimized streaming code or just some cleanup. So start forking!
If you want to add new features or change the API, please submit an issue first to make sure no one else is already working on the same thing and discuss the implementation and API details with maintainers and users by creating an issue. When everything is settled down, you can submit a pull request.
When fixing bugs, you can directly submit a pull request.
Make sure to add tests for your features and bugfixes and update the documentation (see below) before submitting your code!
You can directly submit pull requests for documentation changes.
Scan the following QR Code in WeChat, with secret code wechaty, you can join our Wechaty Developers' Home.
Scan now, then you can chat with other Wechaty developers! (secret code: wechaty)
My daily life/work depends on too much chat on wechat.
- I almost have 14,000 wechat friends in May 2014, before wechat restricts a total number of friends to 5,000.
- I almost have 400 wechat rooms that most of them have more than 400 members.
Can you image that? I'm dying...
So a tireless bot working for me 24x7 on wechat, monitoring/filtering the most important message is badly needed. For example highlights discussion which contains the KEYWORDS which I want to follow up(especially in a noisy room). ;-)
At last, It's built for my personal study purpose of Automatically Testing.
Zhuohuan LI email@example.com (http://linkedin.com/in/zixia)
Copyright & License
- Code & Docs 2016© zixia
- Code released under the ISC license
- Docs released under Creative Commons