https://github.com/node-webot/webot-example
Example usage of weixin-robot
https://github.com/node-webot/webot-example
Last synced: 5 months ago
JSON representation
Example usage of weixin-robot
- Host: GitHub
- URL: https://github.com/node-webot/webot-example
- Owner: node-webot
- Created: 2013-03-30T14:10:03.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-02-15T15:27:08.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T11:24:01.874Z (almost 2 years ago)
- Language: JavaScript
- Size: 414 KB
- Stars: 104
- Watchers: 23
- Forks: 141
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [微信公共帐号机器人](https://github.com/node-webot/weixin-robot)示例 [](https://travis-ci.org/node-webot/webot-example)
## 本地运行
```bash
git clone https://github.com/node-webot/webot-example.git
cd webot-example/
npm install
make start
```
其中,`make start` 命令会调用 `node app.js` 。
建议你 fork 一份自己的版本,这样你就可以任意做出更改和调试了。
## 消息调试
使用 `webot-cli` [命令行工具](https://github.com/node-webot/webot-cli)来发送测试消息。
安装:
```bash
npm install webot-cli -g
```
`npm install -g` 代表全局安装 npm 模块,你可能需要 `sudo` 权限。
使用:
```
webot help # 查看使用帮助
webot send Hello # 发送一条叫「Hello」的消息
webot send image # 调试图片消息
webot send location # 调试地理位置
webot send event # 调试事件消息
```
`webot-cli` 默认访问的接口地址是 http://127.0.0.1:3000 ,要调试本示例的程序,
你需要指定 `webot send --des http://127.0.0.1:3000/wechat'
## 在微信上试用此示例
- 微信账号:webot-test

# 搭建你自己的机器人
1. fork 本仓库,修改 package.json 里的各项属性
2. 修改你自己的 app.js ,填写你在微信后台输入的 token
3. 参考 rules/index.js ,新建你自己的回复规则
## 发布到云平台
仓库中的 `Procfile` 为 [heroku](http://www.heroku.com/) 的配置文件。
`manifest.yml` 为 [cloudfoundry](http://www.cloudfoundry.com/) 的示例配置文件。
# Credit
[weixin-robot](https://github.com/node-webot/weixin-robot) 的[初始版本](https://github.com/node-webot/weixin-robot/tree/0.0.x)由[@ktmud](https://github.com/ktmud)实现,
[@atian](https://github.com/atian25)重构并扩展为 0.2 版本。目前的测试用例也大部分由他完成。
[weixin-robot] 使用了 [@JacksonTian](https://github.com/JacksonTian) 的 [wechat](https://github.com/node-webot/wechat) 组件。