Skip to content

Commit 4b2f7bb

Browse files
committed
Update sendPic sendVideo
support forward
1 parent 1094353 commit 4b2f7bb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/core.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,6 @@ export default class WechatCore {
383383
})
384384
}
385385

386-
sendMsg (msg, to) {
387-
return this.sendText(msg, to)
388-
}
389-
390386
sendText (msg, to) {
391387
return Promise.resolve().then(() => {
392388
let params = {
@@ -619,6 +615,12 @@ export default class WechatCore {
619615
'ClientMsgId': clientMsgId
620616
}
621617
}
618+
// 转发模式
619+
if (typeof mediaId === 'object') {
620+
data.Scene = mediaId.Scene || 2
621+
data.Msg.Content = mediaId.Content
622+
delete data.Msg.MediaId
623+
}
622624
return this.request({
623625
method: 'POST',
624626
url: this.CONF.API_webwxsendmsgimg,
@@ -655,6 +657,12 @@ export default class WechatCore {
655657
'ClientMsgId': clientMsgId
656658
}
657659
}
660+
// 转发模式
661+
if (typeof mediaId === 'object') {
662+
data.Scene = mediaId.Scene || 2
663+
data.Msg.Content = mediaId.Content
664+
delete data.Msg.MediaId
665+
}
658666
return this.request({
659667
method: 'POST',
660668
url: this.CONF.API_webwxsendmsgvedio,

0 commit comments

Comments
 (0)