Skip to content

Commit 8221cf8

Browse files
authored
Merge pull request #166 from nodeWechat/new-feature
2 parents c9e3b29 + b93dcfc commit 8221cf8

33 files changed

+2688
-1208
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ bot.start()
3232

3333
## 开发测试
3434

35-
```
35+
```shell
3636
git clone https://github.com/nodeWechat/wechat4u.git
3737
cd wechat4u
3838
npm install
39-
npm run example // web服务器模式
4039
npm run core // 命令行模式
4140
npm run compile // babel编译
4241
```
@@ -47,10 +46,22 @@ npm run compile // babel编译
4746

4847
逻辑见[代码](https://github.com/nodeWechat/wechat4u/blob/master/run-core.js),简明完整,一定要看
4948

49+
## 实例化Wechat类
50+
51+
```javascript
52+
let bot = new Wechat([botData])
53+
```
54+
55+
若传入`botData`,则使用此机器人信息,重新开始之前的同步
56+
5057
## 实例属性
5158

5259
所有属性均只读
5360

61+
### bot.botData
62+
63+
可导出的实例基本信息,在下次new新bot时,可以填入此信息,重新同步
64+
5465
### bot.PROP
5566

5667
保持登录状态的必要信息
@@ -104,6 +115,10 @@ msg为`Message`对象,具体属性方法见`src/interface/message.js`
104115

105116
调用该方法后,通过监听事件来处理消息
106117

118+
### bot.restart()
119+
120+
利用实例已获取的必要信息,重新登录和进行同步
121+
107122
### bot.stop()
108123

109124
停止实例,退出登录

example/.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

example/README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

example/app.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

example/lib/wxbot.js

Lines changed: 0 additions & 84 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)