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

Method sendVideo

src/core.js:671–707  ·  view source on GitHub ↗
(mediaId, to)

Source from the content-addressed store, hash-verified

669 }
670
671 sendVideo (mediaId, to) {
672 return Promise.resolve().then(() => {
673 let params = {
674 'pass_ticket': this.PROP.passTicket,
675 'fun': 'async',
676 'f': 'json',
677 'lang': 'zh_CN'
678 }
679 let clientMsgId = getClientMsgId()
680 let data = {
681 'BaseRequest': this.getBaseRequest(),
682 'Scene': 0,
683 'Msg': {
684 'Type': this.CONF.MSGTYPE_VIDEO,
685 'MediaId': mediaId,
686 'FromUserName': this.user.UserName,
687 'ToUserName': to,
688 'LocalID': clientMsgId,
689 'ClientMsgId': clientMsgId
690 }
691 }
692 return this.request({
693 method: 'POST',
694 url: this.CONF.API_webwxsendmsgvedio,
695 params: params,
696 data: data
697 }).then(res => {
698 let data = res.data
699 assert.equal(data.BaseResponse.Ret, 0, res)
700 return data
701 })
702 }).catch(err => {
703 debug(err)
704 err.tips = '发送视频失败'
705 throw err
706 })
707 }
708
709 sendDoc (mediaId, name, size, ext, to) {
710 return Promise.resolve().then(() => {

Callers 1

sendMsgMethod · 0.80

Calls 2

getBaseRequestMethod · 0.95
getClientMsgIdFunction · 0.90

Tested by

no test coverage detected