node-webot / webot-example Goto Github PK
View Code? Open in Web Editor NEWExample usage of weixin-robot
Example usage of weixin-robot
我把webot-example克隆下来之后,copy到bae下。
在app.js里修改了token,还有端口3000改为18080,但是微信没办法响应。还需要设置其他什么吗?
// 实际使用时,这里填写你在微信公共平台后台填写的 token
var wx_token = process.env.WX_TOKEN || 'rayliao';
var wx_token2 = process.env.WX_TOKEN_2 || 'rayliao';
// 在环境变量提供的 $PORT 或 3000 端口监听
var port = process.env.PORT || 18080;
app.listen(port, function(){
log("Listening on %s", port);
});
你好,想请教一下. npm install make start 中的make start 是指?我是用node app.js 但是报错了。。实在没用过node.js。能否在帮助里面多稍微写的清楚一些,保证正常都可以调试起来? 谢谢.
规则里面写了
//所有消息都无法匹配时的fallback
webot.set(/.*/, function(info){
// 利用 error log 收集听不懂的消息,以利于接下来完善规则
// 你也可以将这些 message 存入数据库
log('unhandled message: %s', info.text);
info.flag = true;
return '你发送了「' + info.text + '」,可惜我太笨了,听不懂. 发送: help 查看可用的指令';
});
还是不能识别自定义的规则 比如
/ 可以通过回调返回结果
webot.set('search', {
description: '发送: s 关键词 ',
pattern: /^(?:搜索?|search|百度|s\b)\s*(.+)/i,
//handler也可以是异步的
handler: do_search
});
是什么原因呢?
Don't know what you are saying
require('./rules')(weixin); 这个导入的是静态的一个规则js; 我想要规则从数据库存取,请给个思路把。不晓得js文件如何能动态化
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.