好友

发送好友请求

POST /api/friends/request
字段类型说明
usernamestring要添加的用户名
const request = await client.sendFriendRequest('bob')
request = client.send_friend_request("bob")

接受好友请求

POST /api/friends/:id/accept
const friendship = await client.acceptFriendRequest('request-id')
friendship = client.accept_friend_request("request-id")

拒绝好友请求

POST /api/friends/:id/reject
const result = await client.rejectFriendRequest('request-id')
result = client.reject_friend_request("request-id")

删除好友

DELETE /api/friends/:id
await client.removeFriend('friendship-id')
client.remove_friend("friendship-id")

列出好友

GET /api/friends
const friends = await client.listFriends()
friends = client.list_friends()

列出待处理的好友请求

GET /api/friends/pending

返回当前用户收到的尚未接受/拒绝的好友请求。

const pending = await client.listPendingFriendRequests()
pending = client.list_pending_friend_requests()

列出已发送的好友请求

GET /api/friends/sent
const sent = await client.listSentFriendRequests()
sent = client.list_sent_friend_requests()