node-webot / wechat

微信公共平台消息接口服务中间件
Other
5.11k stars 1.18k forks source link

support for sending "sight" / shortvideo ? 发送眼前的景象文件支持? #188

Closed dcsan closed 9 years ago

dcsan commented 9 years ago

(sorry, english only!)

can you send "sight" files?

it looks like "shortvideo" type is supported: https://github.com/node-webot/wechat/blob/master/lib/wechat.js#L383

['text', 'image', 'voice', 'video', 'location', 'link', 'event', 'shortvideo', 'hardware', 'device_text', 'device_event'].forEach(function (method) {
  Handler.prototype[method] = function (fn) {
    return this.setHandler(method, fn);
  };
});

but just not documented. However I cannot get a short video to send.

output = { type: 'shortvideo',
  content: 
   { mediaId: '-9v64QQZnP5ipOF_LeazaqowYpvOI6YfIix9uvyqdGvdNp_ZOJQGTm57ilD-nSaE',
     description: 'clip',
     title: 'my video' 
   } 
}

res.reply(output);

I sent a "sight" file to myself, and then checked the ID. but the file doesn't get sent.

dcsan commented 9 years ago

maybe there is no output XML wrapper? It exists for video but not shortvideo

https://github.com/node-webot/wechat/blob/master/lib/wechat.js#L69

  '<% } else if (msgType === "video") { %>',
    '<Video>',
      '<MediaId><![CDATA[<%-content.mediaId%>]]></MediaId>',
      '<Title><![CDATA[<%-content.title%>]]></Title>',
      '<Description><![CDATA[<%-content.description%>]]></Description>',
    '</Video>',
dcsan commented 9 years ago

maybe shortvideo is just for receive and not for sending?

http://mp.weixin.qq.com/wiki/7/12a5a320ae96fecdf0e15cb06123de9f.html#.E5.8F.91.E9.80.81.E8.A7.86.E9.A2.91.E6.B6.88.E6.81.AF

JacksonTian commented 9 years ago

yes, currently just can receive it. server can not send shortvideo to anyone.

sorry for poor english.

dcsan commented 9 years ago

thanks for your reply! 对不起,我不说中国 :(

it also seems you cannot send it from the admin panel, just from the client.