微信公共平台自动回复消息接口服务中间件
- 自动回复(文本、图片、语音、视频、音乐、图文)
- 等待回复(用于调查问卷、问答等场景)
- 会话支持(创新功能)
- 目前功能只有文本被动回复可以使用 详细参见微信官方API文档
$ npm install wechatjs
var wechatjs = require('wechatjs');
var wechat=new wechatjs()
var port=3000
wechat.set({
token:'myWechat'
})
var http=require('http')
http.createServer(wechat).listen(port)
备注:token在微信平台的开发者中心申请
当用户发送消息到微信公众账号,自动回复一条消息。这条消息可以是文本、图片、语音、视频、音乐、图文。详见:官方文档
wechat.on('text',function(obj){
console.log(obj)
return `you say: ${obj.Content}`
})
The MIT license.