MCPcopy
hub / github.com/nodeWechat/wechat4u / getVoice

Method getVoice

src/core.js:879–902  ·  view source on GitHub ↗
(msgId)

Source from the content-addressed store, hash-verified

877 }
878
879 getVoice (msgId) {
880 return Promise.resolve().then(() => {
881 let params = {
882 MsgID: msgId,
883 skey: this.PROP.skey
884 }
885
886 return this.request({
887 method: 'GET',
888 url: this.CONF.API_webwxgetvoice,
889 params: params,
890 responseType: 'arraybuffer'
891 }).then(res => {
892 return {
893 data: res.data,
894 type: res.headers['content-type']
895 }
896 })
897 }).catch(err => {
898 debug(err)
899 err.tips = '获取声音失败'
900 throw err
901 })
902 }
903
904 getHeadImg (HeadImgUrl) {
905 return Promise.resolve().then(() => {

Callers 1

run-core.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected