Skip to content

Commit

Permalink
增加私信专辑功能
Browse files Browse the repository at this point in the history
  • Loading branch information
7lsu committed Feb 27, 2021
1 parent 1eb178d commit cd17ccf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2907,20 +2907,37 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`

**调用例子 :** `/send/text?user_ids=32953014&msg=test`,`/send/text?user_ids=32953014,475625142&msg=test`

### 发送私信音乐
### 发送私信(带歌曲)

说明 : 登录后调用此接口 , 传入用户 id 和要发送的信息,音乐id, 可以发送音乐私信,返回内容为历史私信

**必选参数 :**

`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=测试`

### 发送私信(带歌单)

Expand Down
18 changes: 18 additions & 0 deletions module/send_album.js
Original file line number Diff line number Diff line change
@@ -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,
})
}

0 comments on commit cd17ccf

Please sign in to comment.