Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ app.use('/wechat', wechat('some token', function (req, res, next) {
title: "来段音乐吧",
description: "一无所有",
musicUrl: "http://mp3.com/xx.mp3",
hqMusicUrl: "http://mp3.com/xx.mp3"
hqMusicUrl: "http://mp3.com/xx.mp3",
thumbMediaId: "thisThumbMediaId"
}
});
} else {
Expand Down Expand Up @@ -105,8 +106,9 @@ res.reply({
res.reply({
type: "video",
content: {
mediaId: 'mediaId',
thumbMediaId: 'thumbMediaId'
title: '来段视频吧',
description: '女神与高富帅',
mediaId: 'mediaId'
}
});
```
Expand All @@ -116,7 +118,8 @@ res.reply({
title: "来段音乐吧",
description: "一无所有",
musicUrl: "http://mp3.com/xx.mp3",
hqMusicUrl: "http://mp3.com/xx.mp3"
hqMusicUrl: "http://mp3.com/xx.mp3",
thumbMediaId: "thisThumbMediaId"
});
```
#### 回复图文
Expand Down
1 change: 1 addition & 0 deletions lib/wechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var tpl = ['<xml>',
'<Description><![CDATA[<%-content.description%>]]></Description>',
'<MusicUrl><![CDATA[<%-content.musicUrl || content.url %>]]></MusicUrl>',
'<HQMusicUrl><![CDATA[<%-content.hqMusicUrl || content.hqUrl %>]]></HQMusicUrl>',
'<ThumbMediaId><![CDATA[<%-content.thumbMediaId || content.mediaId %>]]></ThumbMediaId>',
'</Music>',
'<% } else if (msgType === "voice") { %>',
'<Voice>',
Expand Down