Skip to content

Commit

Permalink
Update intimacy relation doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Jan 3, 2025
1 parent 9bb31bb commit 31880f5
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions docs/quick_reference/http_api/friend.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ IReadOnlyCollection<RestFriendRequest> friendRequests = await _restClient.GetFri

// API 请求,获取屏蔽用户列表
IReadOnlyCollection<RestUser> blockedUsers = await _restClient.GetBlockedUsersAsync();

// API 请求,获取亲密关系列表
IReadOnlyCollection<RestIntimacyRelation> intimacyRequests = await _restClient.GetIntimacyRelationsAsync();

// API 请求,获取亲密关系请求列表
IReadOnlyCollection<RestIntimacyRelationRequest> intimacyRequests = await _restClient.GetIntimacyRelationRequestsAsync();
```

### [好友申请]
Expand All @@ -43,8 +49,7 @@ await user.RequestFriendAsync();
POST `/api/v3/friend/handle-request`

```csharp
// 好友申请
RestFriendRequest friendRequest = null;
RestFriendRequest friendRequest = null; // 待处理的好友申请
// API 请求,接受好友申请
await friendRequest.AcceptAsync();
Expand All @@ -62,6 +67,45 @@ POST `/api/v3/friend/delete`
await user.RemoveFriendAsync();
```

### 亲密关系申请

POST `/api/v3/friend/create-relation`

```csharp
IntimacyRelationType relationType = default; // 亲密关系类型
// API 请求
await user.RequestIntimacyRelationAsync(relationType);
```

### 处理亲密关系申请

POST `/api/v3/friend/handle-relation`

```csharp
IIntimacyRelationRequest intimacyRequest = null; // 待处理的亲密关系申请
// API 请求,接受亲密关系申请
await intimacyRequest.AcceptAsync();

// API 请求,拒绝亲密关系申请
await intimacyRequest.DeclineAsync();
```

### 解除亲密关系

POST `/api/v3/friend/unravel-relation`

```csharp
IIntimacyRelation intimacyRelation = null; // 待解除的亲密关系
bool removeFriend = false; // 是否同时删除好友
// API 请求,在亲密关系实体上调用
await intimacyRelation.UnravelAsync(removeFriend);
// API 请求,在用户实体上调用
await user.UnravelIntimacyRelationAsync(removeFriend);
```

### [屏蔽用户]

POST `/api/v3/friend/block`
Expand All @@ -80,6 +124,8 @@ POST `/api/v3/friend/unblock`
await user.UnblockAsync();
```

###

[好友列表]: https://developer.kookapp.cn/doc/http/friend#好友列表
[好友申请]: https://developer.kookapp.cn/doc/http/friend#好友申请
[处理好友申请]: https://developer.kookapp.cn/doc/http/friend#处理好友申请
Expand Down

0 comments on commit 31880f5

Please sign in to comment.