diff --git a/docs/README.md b/docs/README.md index 40fed39..cabe9c6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2907,7 +2907,7 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子 :** `/send/text?user_ids=32953014&msg=test`,`/send/text?user_ids=32953014,475625142&msg=test` -### 发送私信音乐 +### 发送私信(带歌曲) 说明 : 登录后调用此接口 , 传入用户 id 和要发送的信息,音乐id, 可以发送音乐私信,返回内容为历史私信 @@ -2915,12 +2915,29 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` `user_ids` : 用户 id,多个需用逗号隔开 +`id` : 要发送音乐的id + `msg` : 要发送的信息 **接口地址 :** `/send/song` **调用例子 :** `/send/song?user_ids=1&id=351318&msg=测试` +### 发送私信(带专辑) + +说明 : 登录后调用此接口 , 传入用户 id 和要发送的信息,专辑id, 可以发送专辑私信,返回内容为消息id + +**必选参数 :** + +`user_ids` : 用户 id,多个需用逗号隔开 + +`id` : 要发送专辑的id + +`msg` : 要发送的信息 + +**接口地址 :** `/send/album` + +**调用例子 :** `/send/album?user_ids=1&id=351318&msg=测试` ### 发送私信(带歌单) diff --git a/module/send_album.js b/module/send_album.js new file mode 100644 index 0000000..8af5673 --- /dev/null +++ b/module/send_album.js @@ -0,0 +1,18 @@ +// 私信专辑 + +module.exports = (query, request) => { + query.cookie.os = 'ios' + query.cookie.appver = '8.1.20' + const data = { + id: query.id, + msg: query.msg || '', + type: 'album', + userIds: '[' + query.user_ids + ']', + } + return request('POST', `https://music.163.com/api/msg/private/send`, data, { + crypto: 'api', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +}