Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #27 from HalfdogStudio/linux
Browse files Browse the repository at this point in the history
for Linux
  • Loading branch information
reverland committed Jan 26, 2016
2 parents 0899ff9 + c0643fd commit 4fcc9f0
Show file tree
Hide file tree
Showing 7 changed files with 438 additions and 1,289 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
> 从SICP摘抄

(2016.1.20): 应该算是个可靠可用的文本信息机器人了。
(2016.1.26): 应该算是个可靠可用的文本信息机器人了。

作者仅仅为了:

Expand All @@ -31,11 +31,23 @@

当前代码使用方式

node test.js
node index.js

扫描二维码确认登录。

目前是个聊天机器人,对话引擎默认使用图灵机器人。需要自行申请图灵机器人的API,保存到`apikeys.js`文件内:
目前是个聊天和记录机器人,对话引擎默认为重复(echo),可指定其它引擎。

文件解构如下:

webwx.js:web微信相关函数
cache.js:缓存联系人
logger.js: 信息记录函数
global.js: 常量声明和定义
reply.js: 回复逻辑
dialog.js: 聊天引擎
apikeys.js: api文件

如果使用图灵机器人,需要自行申请图灵机器人的API,保存到`apikeys.js`文件内:

module.exports.turingRobotApiKey = '你申请的key';

Expand All @@ -59,11 +71,15 @@ request:

- [ ] 协议文档
- [X] 分离回复逻辑
- [ ] 分离消息处理逻辑
- [X] 分离消息处理逻辑
- [ ] 修复已知问题

## ChangLog

### 2016.1.26

- 分离逻辑与重构

### 2016.1.20

- 更加健壮的对话引擎
Expand Down
29 changes: 29 additions & 0 deletions doc/robot.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# [email protected]
# LiuYuyang


graph robot {
rankdir=BT;
bgcolor="#f6f6f6";
color="#b5e77d";

# 样式
node [style=filled,color="black", fillcolor="#85d1df", shape=box];
edge [color="darkblue", fontcolor="darkblue"];
style="filled";
fillcolor="#b5e77d";

webwx[label="微信机器人"];
dialog[label="对话引擎"];
global[label="变量声明"];
logger[label="消息记录"];
reply[label="消息回复"];
cache[label="信息缓存"];
apikeys[label="api配置"];
main[label="入口程序"];

{logger, reply, cache, global} -- webwx;
webwx -- main;
{apikeys, dialog} -- reply;
}

81 changes: 81 additions & 0 deletions doc/robot.dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4fcc9f0

Please sign in to comment.