Skip to content
Eric edited this page Mar 28, 2016 · 1 revision

当用户向您发送消息后,系统可以在24小时内向用户推送相应的回复.

回复消息

var reply = nodeWeixinMessage.reply;
//res是HTTP的res

//回复文本
var text = reply.text('FromUserName', 'ToUserName', 'content');
res.send(text)

//回复图片
var image = reply.image('FromUserName', 'ToUserName', 'mediaId');
res.send(image)

//回复视频
var video = reply.video('FromUserName', 'ToUserName', 'mediaId', 'title', 'desc');
res.send(video);

//回复音乐
var music = reply.music('FromUserName', 'ToUserName', 'mediaId', 'title',
'desc', 'http://www.musicurl.com', 'http://www.hightQualitymusicurl.com');
res.send(music);


//回复图文
var news = reply.news('FromUserName', 'ToUserName', [{
    title: 'title1',
    description: 'description1',
    picUrl: 'picUrl1',
    url: 'url1'
  },
  {
    title: 'title2',
    description: 'description2',
    picUrl: 'picUrl2',
    url: 'url2'
  },
  {
    title: 'title3',
    description: 'description3',
    picUrl: 'picUrl3',
    url: 'url3'
  }]);
res.send(news);
Clone this wiki locally