Comments (6)
请参考: node-webot/webot-example#3
from weixin-robot.
好的,还有就是现在包含的wechat包貌似不是最新版的。是否能跟新一下?
from weixin-robot.
还有一个问题就是当我有多条图文作为回复时,webot只是随机抽取一个来显示,因为它使用[]来表示随机显示一个。我应该如果在handler里面返回多条图文消息呢?
from weixin-robot.
如果你都能拿到底层wechat传上来的req和res。那么res.reply()方法是提供了响应图文消息的方式的。具体参见: https://github.com/node-webot/wechat#回复图文
from weixin-robot.
@AngelaZou handler 直接定义为一个数组时,会取数组中的随机元素做回复,handler 函数返回数组时,会生成图文回复
区别就在于:
webot.set({
handler: [
'文字回复1',
'文字回复2',
function(info) {
return '';
},
[{ 图文1 }, { 图文2} ..]
]
});
随机回复一个
webot.set({
handler: function(info) {
return [{ 图文1 }, { 图文2 }];
}
})
回复图文列表
from weixin-robot.
好的,这个方法管用了。我发现其实也可以在我原来的内容的外部再套一个数组,这样就是让他随机选择,但是只能选择这一个:)
from weixin-robot.
Related Issues (20)
- Doc里面似乎有个小错误 HOT 2
- handler里使用异步事件 HOT 1
- 请问新出的语音辨识接口加上了吗? HOT 5
- 语音识别接口还是有bug HOT 5
- 链接菜单没有跳转 HOT 4
- 经常会出现204请求 HOT 1
- 微信多次发送消息 HOT 4
- 能否拿到发信的人的ip地址? HOT 3
- 机器人自动回复时, 回复内容可以在别的回调函数里面吗(wechat单独使用,指定res.reply是可以的) HOT 4
- 在handler中return图文信息的时候url无法带入多个参数 HOT 2
- 微博也做了类似的post推送机制,能否兼容一下? HOT 3
- 该公众号暂时无法提供服务,请稍后再试 HOT 4
- 请教下 如何把yaml修改为json么? HOT 2
- 有计划支持安全模式么? HOT 4
- 代码全是express3.x的,有没有express4.x以上版本? HOT 1
- 多客服系统没有接入么? HOT 5
- 配置正常,但是没有自动回复 HOT 1
- 为什么老会显示don't konw what you are saying HOT 2
- 规则库
- 国务院与该项目的合作
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weixin-robot.