Wechaty is a Bot Framework for Wechat **Personal** Account which can help you create a bot in 6 lines of javascript by easy to use API, with cross-platform support include [Linux](https://travis-ci.org/wechaty/wechaty), [Windows](https://ci.appveyor.com/project/wechaty/wechaty), [Darwin(OSX/Mac)](https://travis-ci.org/wechaty/wechaty) and [Docker](https://circleci.com/gh/wechaty/wechaty).
Wechaty is a Bot Framework for Wechat **Personal** Account which can help you create a bot in 6 lines of javascript by easy to use API, with cross-platform support include [Linux](https://travis-ci.org/Chatie/wechaty), [Windows](https://ci.appveyor.com/project/Chatie/wechaty), [Darwin(OSX/Mac)](https://travis-ci.org/Chatie/wechaty) and [Docker](https://circleci.com/gh/Chatie/wechaty).
[![Join the chat at https://gitter.im/zixia/wechaty](https://badges.gitter.im/zixia/wechaty.svg)](https://gitter.im/zixia/wechaty?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![node](https://img.shields.io/node/v/wechaty.svg?maxAge=604800)](https://nodejs.org/) [![Repo Size](https://reposs.herokuapp.com/?path=wechaty/wechaty)](https://github.com/wechaty/wechaty) [![Issue Stats](http://issuestats.com/github/wechaty/wechaty/badge/pr)](http://issuestats.com/github/wechaty/wechaty) [![Issue Stats](http://issuestats.com/github/wechaty/wechaty/badge/issue)](http://issuestats.com/github/wechaty/wechaty)
[![Join the chat at https://gitter.im/zixia/wechaty](https://badges.gitter.im/zixia/wechaty.svg)](https://gitter.im/zixia/wechaty?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![node](https://img.shields.io/node/v/wechaty.svg?maxAge=604800)](https://nodejs.org/) [![Repo Size](https://reposs.herokuapp.com/?path=Chatie/wechaty)](https://github.com/Chatie/wechaty) [![Issue Stats](http://issuestats.com/github/Chatie/wechaty/badge/pr)](http://issuestats.com/github/Chatie/wechaty) [![Issue Stats](http://issuestats.com/github/Chatie/wechaty/badge/issue)](http://issuestats.com/github/Chatie/wechaty)
> "Wechaty is great." [link](https://github.com/wechaty/wechaty/issues/36#issuecomment-251708382)
> "Wechaty is a great solution, I believe there would be much more users recognize it." [link](https://github.com/Chatie/wechaty/pull/310#issuecomment-285574472)
> -- @Gcaufy, Tencent
> "Wechaty is great." [link](https://github.com/Chatie/wechaty/issues/36#issuecomment-251708382)
> "Thanks for great SDK" [link](https://github.com/wechaty/wechaty/issues/57) - @naishstar
> "Thanks for great SDK" [link](https://github.com/Chatie/wechaty/issues/57) - @naishstar
> "Your docker solution is awesome!" [link](https://github.com/wechaty/wechaty/issues/164#issuecomment-278633203) - @ax4
> "Your docker solution is awesome!" [link](https://github.com/Chatie/wechaty/issues/164#issuecomment-278633203) - @ax4
# The World's Shortest ChatBot Code: 6 lines of JavaScript
...
...
@@ -55,7 +58,7 @@ Wechaty.instance() // Singleton
This bot can log all message to console.
You can find more example from [Wiki](https://github.com/wechaty/wechaty/wiki/Example) and [Example Directory](https://github.com/wechaty/wechaty/blob/master/example/).
You can find more example from [Wiki](https://github.com/Chatie/wechaty/wiki/Example) and [Example Directory](https://github.com/Chatie/wechaty/blob/master/example/).
1.[instance(setting: PuppetSetting): Promise<Wechaty>](https://github.com/wechaty/wechaty/wiki/API#wechatyinstanceprofilestring-wechaty) get the bot instance
2.[init(): Promise<void>](https://github.com/wechaty/wechaty/wiki/API#wechatyinit-wechaty) Initialize the bot
3.[send(message: Message): Promise<void>](https://github.com/wechaty/wechaty/wiki/API#wechatysendmessage-message-wechaty) send a message
4.[say(content: string): Promise<void>](https://github.com/wechaty/wechaty/wiki/API#wechatysaycontent-string) send message to filehelper, just for logging/reporting usage for your convenience
1.[instance(setting: PuppetSetting): Promise<Wechaty>](https://github.com/Chatie/wechaty/wiki/API#wechatyinstanceprofilestring-wechaty) get the bot instance
2.[init(): Promise<void>](https://github.com/Chatie/wechaty/wiki/API#wechatyinit-wechaty) Initialize the bot
3.[send(message: Message): Promise<void>](https://github.com/Chatie/wechaty/wiki/API#wechatysendmessage-message-wechaty) send a message
4.[say(content: string): Promise<void>](https://github.com/Chatie/wechaty/wiki/API#wechatysaycontent-string) send message to filehelper, just for logging/reporting usage for your convenience
1.[from():Contact](https://github.com/wechaty/wechaty/wiki/API#1-messagefrom-contact) get the sender from a message
2.[from(contact:Contact):void](https://github.com/wechaty/wechaty/wiki/API#2-messagefromcontact-contact-void) set a sender to the message
4.[to():Contact](https://github.com/wechaty/wechaty/wiki/API#1-messageto-contact) get the destination of the message
5.[to(contact:Contact):void](https://github.com/wechaty/wechaty/wiki/API#2-messagetocontact-contact-void) set the destination as contact for the message
7.[content():string](https://github.com/wechaty/wechaty/wiki/API#1-messagecontent-string) get the content of the message
8.[content(content:string):string](https://github.com/wechaty/wechaty/wiki/API#2-messagecontentcontent-string-string) set the content for the message
9.[room():Room|null](https://github.com/wechaty/wechaty/wiki/API#1-messageroom-room--null) get the room from a message.
10.[room(room:Room):void](https://github.com/wechaty/wechaty/wiki/API#2-messageroomroom-room-void) set the room for a message.
12.[type():MsgType](https://github.com/wechaty/wechaty/wiki/API#messagetype-number) get the type of a Message.
13.[say(content:string):Promise](https://github.com/wechaty/wechaty/wiki/API#messagesaycontent-string-promise) reply a message to the sender.
14.[ready():Promise](https://github.com/wechaty/wechaty/wiki/API#messageready-promise) confirm get all the data needed, will be resolved when all message data is ready.
15.[self():boolean](https://github.com/wechaty/wechaty/wiki/API#messageselfmessage-message-boolean) check if a message is sent by self
1.[from():Contact](https://github.com/Chatie/wechaty/wiki/API#1-messagefrom-contact) get the sender from a message
2.[from(contact:Contact):void](https://github.com/Chatie/wechaty/wiki/API#2-messagefromcontact-contact-void) set a sender to the message
4.[to():Contact](https://github.com/Chatie/wechaty/wiki/API#1-messageto-contact) get the destination of the message
5.[to(contact:Contact):void](https://github.com/Chatie/wechaty/wiki/API#2-messagetocontact-contact-void) set the destination as contact for the message
7.[content():string](https://github.com/Chatie/wechaty/wiki/API#1-messagecontent-string) get the content of the message
8.[content(content:string):string](https://github.com/Chatie/wechaty/wiki/API#2-messagecontentcontent-string-string) set the content for the message
9.[room():Room|null](https://github.com/Chatie/wechaty/wiki/API#1-messageroom-room--null) get the room from a message.
10.[room(room:Room):void](https://github.com/Chatie/wechaty/wiki/API#2-messageroomroom-room-void) set the room for a message.
12.[type():MsgType](https://github.com/Chatie/wechaty/wiki/API#messagetype-number) get the type of a Message.
13.[say(content:string):Promise](https://github.com/Chatie/wechaty/wiki/API#messagesaycontent-string-promise) reply a message to the sender.
14.[ready():Promise](https://github.com/Chatie/wechaty/wiki/API#messageready-promise) confirm get all the data needed, will be resolved when all message data is ready.
15.[self():boolean](https://github.com/Chatie/wechaty/wiki/API#messageselfmessage-message-boolean) check if a message is sent by self
2.[name():string](https://github.com/wechaty/wechaty/wiki/API#contactname-string) get name from a contact
3.[remark():string](https://github.com/wechaty/wechaty/wiki/API#contactremark-string) get remark name from a contact
4.[remark(remark:string):Promise](https://github.com/wechaty/wechaty/wiki/API#contactremarkremark-string-promise) set remark name to a contact
5.[weixin():string](https://github.com/wechaty/wechaty/wiki/API#contactweixin-string) get weixin id from a contact
6.[star():boolean](https://github.com/wechaty/wechaty/wiki/API#contactstar-boolean) true for star friend, false for no star friend
7.[ready():Promise](https://github.com/wechaty/wechaty/wiki/API#contactready-promise) confirm get all the contact data needed, will be resolved when all data is ready
8.[say(content:string):Promise](https://github.com/wechaty/wechaty/wiki/API#contactsaycontent-string-promise) say content to a contact
2.[name():string](https://github.com/Chatie/wechaty/wiki/API#contactname-string) get name from a contact
3.[remark():string](https://github.com/Chatie/wechaty/wiki/API#contactremark-string) get remark name from a contact
4.[remark(remark:string):Promise](https://github.com/Chatie/wechaty/wiki/API#contactremarkremark-string-promise) set remark name to a contact
5.[weixin():string](https://github.com/Chatie/wechaty/wiki/API#contactweixin-string) get weixin id from a contact
6.[star():boolean](https://github.com/Chatie/wechaty/wiki/API#contactstar-boolean) true for star friend, false for no star friend
7.[ready():Promise](https://github.com/Chatie/wechaty/wiki/API#contactready-promise) confirm get all the contact data needed, will be resolved when all data is ready
8.[say(content:string):Promise](https://github.com/Chatie/wechaty/wiki/API#contactsaycontent-string-promise) say content to a contact
1.[say(content:string,replyTo:Contact|ContactArray):Promise](https://github.com/wechaty/wechaty/wiki/API#roomsaycontent-string-replyto-contactcontact-promise) say content inside Room.
2.[ready():Promise](https://github.com/wechaty/wechaty/wiki/API#roomready-promise) confirm get all the data needed, will be resolved when all data is ready
3.[refresh():Promise](https://github.com/wechaty/wechaty/wiki/API#roomrefresh-promise) reload data for Room
1.[say(content:string,replyTo:Contact|ContactArray):Promise](https://github.com/Chatie/wechaty/wiki/API#roomsaycontent-string-replyto-contactcontact-promise) say content inside Room.
2.[ready():Promise](https://github.com/Chatie/wechaty/wiki/API#roomready-promise) confirm get all the data needed, will be resolved when all data is ready
3.[refresh():Promise](https://github.com/Chatie/wechaty/wiki/API#roomrefresh-promise) reload data for Room
1.[hello:string](https://github.com/wechaty/wechaty/wiki/API#friendrequesthello-string) get content from friendrequest
2.[accept():Promise](https://github.com/wechaty/wechaty/wiki/API#friendrequestaccept-void) accept the friendrequest
3.[send(contact:Contact,hello:string):Promise](https://github.com/wechaty/wechaty/wiki/API#friendrequestsendcontact-contact-hello-string-void) send a new friend request
1.[hello:string](https://github.com/Chatie/wechaty/wiki/API#friendrequesthello-string) get content from friendrequest
2.[accept():Promise](https://github.com/Chatie/wechaty/wiki/API#friendrequestaccept-void) accept the friendrequest
3.[send(contact:Contact,hello:string):Promise](https://github.com/Chatie/wechaty/wiki/API#friendrequestsendcontact-contact-hello-string-void) send a new friend request
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!
...
...
@@ -222,13 +225,13 @@ 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**.