Wechaty is a Bot Framework for Wechat **Personal** Account that help you easy creating personal wechat bot in only 6 lines of javascript code, with cross platform support to [linux](https://travis-ci.org/wechaty/wechaty), [win32](https://ci.appveyor.com/project/zixia/wechaty) and [darwin(OSX/Mac)](https://travis-ci.org/wechaty/wechaty).
Wechaty is a Bot Framework for Wechat **Personal** Account that helps you easy creating personal wechat bot in only 6 lines of javascript code, with cross-platform support to [linux](https://travis-ci.org/wechaty/wechaty), [win32](https://ci.appveyor.com/project/zixia/wechaty) and [darwin(OSX/Mac)](https://travis-ci.org/wechaty/wechaty).
[VSCode](https://code.visualstudio.com/) is recommended for typescript because we can get benifit of [intelligent code completion, parameter info, and member lists](https://code.visualstudio.com/docs/languages/javascript).
[VSCode](https://code.visualstudio.com/) is recommended for typescript because we can get the benefit of [intelligent code completion, parameter info, and member lists](https://code.visualstudio.com/docs/languages/javascript).
The last Javascript version is: [v0.4.0](https://github.com/wechaty/wechaty/releases/tag/v0.4.0)(2016/10/9) , or install v0.4 by `npm install wechaty`.
...
...
@@ -34,13 +34,13 @@ The last Javascript version is: [v0.4.0](https://github.com/wechaty/wechaty/rele
## Voice of the Developer
> @JasLin : it may be the best wecaht sdk i have seen in github! [link](https://github.com/wechaty/wechaty/issues/8#issuecomment-228971491)
> @JasLin : it may be the best wechat SDK I have seen in Github! [link](https://github.com/wechaty/wechaty/issues/8#issuecomment-228971491)
Notice that you need to wait a moment while bot trys to get the login QRCode from Wechat. As soon as the bot gets login QRCode url, he will print url out. You need to scan the qrcode on wechat, and confirm login.
Notice that you need to wait a moment while bot tries to get the login QRCode from Wechat. As soon as the bot gets login QRCode URL, he will print URL out. You need to scan the QR code on wechat and confirm login.
After that, bot will be on duty. (roger-bot source can be found at [here](https://github.com/wechaty/wechaty/blob/master/example/roger-bot.js))
After that, the bot will be on duty. (roger-bot source can be found at [here](https://github.com/wechaty/wechaty/blob/master/example/roger-bot.js))
## 2. Advanced: dozens of lines
Here's an chatbot [ding-dong-bot](https://github.com/wechaty/wechaty/blob/master/example/ding-dong-bot.js) who can reply _dong_ when receives a message _ding_.
Here's a chatbot [ding-dong-bot](https://github.com/wechaty/wechaty/blob/master/example/ding-dong-bot.js) who can reply _dong_ when receives a message _ding_.
## 3. Hardcore: hundreds of lines
Here's a chatbot [api-ai-bot](https://github.com/wechaty/wechaty/blob/master/example/api-ai-bot.js), who can slightly understand NLP.
Natual Language Understanding enabled by [api.AI](https://api.ai), you can get your module on api.AI by it's free plan.
Natural Language Understanding enabled by [api.AI](https://api.ai), you can get your module on api.AI by its free plan.
# Deploy
...
...
@@ -94,7 +94,7 @@ export TOKEN="your token here"
docker run -eWECHATY_TOKEN="$TOKEN" wechaty/wechaty
```
`WECHATY_TOKEN` is required here, because you need this key to manage wechaty on the chatbot cloud manager: https://www.wechaty.io
`WECHATY_TOKEN` is required here, because you need this key to managing wechaty on the chatbot cloud manager: https://www.wechaty.io
### Build
...
...
@@ -104,10 +104,10 @@ docker build -t wechaty .
### Ship
Wechaty can be used via: Container as a Service
Wechaty can be used via Container as a Service
*[Arukas Cloud](https://arukas.io/en/) - Hosting Docker Containers(Currently in Beta, provide up to 10 **free containers**)
*[Docker Cloud](https://cloud.docker.com/) - Docker Cloud is a hosted service that provides a Registry with build and testing facilities for Dockerized application images, tools to help you set up and manage your host infrastructure, and deployment features to help you automate deploying your images to your infrastructure.
*[Docker Cloud](https://cloud.docker.com/) - Docker Cloud is a hosted service that provides a Registry with the build and testing facilities for Dockerized application images, tools to help you set up and manage your host infrastructure, and deployment features to help you automate deploying your images to your infrastructure.
*[Dao Cloud](https://www.daocloud.io/) - 容器云平台
## Deploy with Heroku
...
...
@@ -135,16 +135,16 @@ npm install --save wechaty
If you use chrome instead of phantomjs, you should make sure:
1. chrome is installed
1. if you are under linux, set headless right for `Xvfb`
1. if you are under Linux, set headless right for `Xvfb`
*[Running a GUI application in a Docker container](https://linuxmeerkat.wordpress.com/2014/10/17/running-a-gui-application-in-a-docker-container/)
Then you are set.
## Install to Cloud9 IDE
[Cloud9 IDE](https://c9.io/) is Google Docs for Code, which is my favourite IDE today. Almost all my wechaty development is based on Cloud9.
[Cloud9 IDE](https://c9.io/) is Google Docs for Code, which is my favorite IDE today. Almost all my wechaty development is based on Cloud9.
> Cloud9 IDE written in JavaScript, uses Node.js on the back-end. It uses Docker containers for its workspaces, and hosted on Google Compute Engine.
> Cloud9 IDE written in JavaScript uses Node.js on the back-end. It uses Docker containers for its workspaces and hosted on Google Compute Engine.
### 1. Open in Cloud9 IDE
...
...
@@ -188,7 +188,7 @@ Node.js Version 6.0 or above is required.
### 2. Fork & Clone Wechaty
If you have no github account, you can just clone it via https:
If you have no GitHub account, you can just clone it via https:
```shell
git clone https://github.com/wechaty/wechaty.git
```
...
...
@@ -201,7 +201,7 @@ npm install
npm run demo
```
After a little while, bot will show you a message of a url for Login QrCode. You need to scan this qrcode in your wechat in order to permit your bot login.
After a little while, bot will show you a message of an URL for Login QrCode. You need to scan this QR code in your wechat in order to permit your bot login.
### 4. Done
...
...
@@ -245,7 +245,7 @@ $ WECHATY_LOG=silly npm test
## LOG output
Wechaty use [npmlog](https://www.npmjs.com/package/npmlog) to output log message. You can set log level by environment variable `WECHATY_LOG` to show log message.
environment variable `WECHATY_LOG` values:
the environment variable `WECHATY_LOG` values:
1.`silly`
1.`verbose`
...
...
@@ -296,7 +296,7 @@ Here's a quick and dirty patch, to npmlog/log.js
}
```
And we can looking forward the official support from npmlog: https://github.com/npm/npmlog/pull/24
And we can look forward the official support from npmlog: https://github.com/npm/npmlog/pull/24
## DEBUG
...
...
@@ -309,13 +309,13 @@ this will:
ECMAScript2015(ES6). I develop and test wechaty with Node.js v6.0.
# API Refference
# API Reference
I'll try my best to keep the api as sample as it can be.
I'll try my best to keep the API as simple as it can be.
## Events
Wechaty support the following 6 events:
Wechaty supports the following 6 events:
1. scan
2. login
...
...
@@ -340,11 +340,11 @@ Notice: when we want to use `this` inside a listener, we must use the traditiona
})
```
which means there will be a `this.say()` method inside listener call, you can use it sending message to `filehelper`, just for logging / reporting / any usage for your convienience
which means there will be a `this.say()` method inside listener call, you can use it sending message to `filehelper`, just for logging / reporting / any usage for your convenience
### 1. Event: `scan`
A `scan` event will be emitted when the bot need to show you a QrCode for scaning.
A `scan` event will be emitted when the bot needs to show you a QR Code for scanning.
which means there will be a `this.say()`method inside listener call, you can use it sending message to `filehelper`, just for logging / reporting / any usage for your convienience
which means there will be a `this.say()`the method inside listener call, you can use it sending a message to `filehelper`, just for logging / reporting / any usage for your convenience
#### Event: `join`
...
...
@@ -670,7 +670,7 @@ room.get('members').length
Send, receive friend request, and friend confirmation events.
When someone send you a friend request, there will be a Wechaty `friend` event fired.
When someone sends you a friend request, there will be a Wechaty `friend` event fired.
3.[CleverScript](https://www.cleverscript.com) Easily create text, voice or avatar bots that people can chat with in browser, app or their preferred messaging platform.
## Application
1.[助手管家](http://72c.me/a/m/yhmhrh) It's a Official Account of wechat, which can manage your personal wechat account as a robot assistant.
1.[助手管家](http://72c.me/a/m/yhmhrh) It's an Official Account of wechat, which can manage your personal wechat account as a robot assistant.
## Service
1.[Luis.ai](https://www.luis.ai) Language Understanding Intelligent Service (LUIS) offers a fast and effective way of adding language understanding to applications from Microsoft
*[Advanced Natural Language Processing Tools for Bot Makers](https://stanfy.com/blog/advanced-natural-language-processing-tools-for-bot-makers/) a good article of comparing the above services.
## Framework
1.[Bot Framework](https://dev.botframework.com/) Build and connect intelligent bots to interact with your users naturally wherever they are, from text/sms to Skype, Slack, Office 365 mail and other popular services. from Microsoft
1.[Bot Framework](https://dev.botframework.com/) Build and connect intelligent bots to interact with your users naturally wherever they are, from text/SMS to Skype, Slack, Office 365 mail and other popular services. from Microsoft
My Story
----------------
My daily life/work depends on too much chat on wechat.
* I almost have 14,000 wechat friends till May 2014, before wechat restricts a total number of friends to 5,000.
* 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, moniting/filtering the most important message is badly needed. For example: highlights discusstion which contains the KEYWORDS I want to follow up(especially in a noisy room). ;-)
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.