# 好友

## 好友管理

Game Chat 提供了邀请和管理朋友的功能，以便用户之间的社交网络更加便利。通过这一系统，用户可以执行邀请朋友、接受请求、拒绝请求、删除朋友等各种好友管理操作。以下是好友管理功能的主要细节及每个功能的使用方法。

## 好友列表

用户可以查看好友列表，并且可以按特定状态筛选好友。列表通过分页选项进行管理，以便有效处理大量用户。

```csharp
Hashtable filter = new Hashtable
{
    { "status", "accepted" },
};
Hashtable sort = new Hashtable
{
    { "created_at", -1 },
};
Hashtable option = new Hashtable
{
    { "offset", 0 },
    { "per_page", 10 },
};
var friends = await nc.getFriendships(filter, sort, option);
```

* filter: 按照要查看的朋友状态（例如“accepted”）进行筛选。
* sort: 设置结果排序的标准。在这里，根据创建时间降序排序。
* option: 设置要查看的数据范围。offset 是数据的起始位置，per\_page 是每页返回的项目数量。

## 邀请

邀请特定用户成为好友。被邀请的用户可以接受或拒绝此请求。

```csharp
var response = await nc.requestFriend(friendId);
```

* **friendId**: 要邀请的用户的标识符。

## 接受

接受收到的好友邀请。这样，两位用户将成为相互好友关系。

```csharp
var response = await nc.acceptFriend(friendId);
```

* **friendId**: 要接受的好友邀请的用户标识符。

## 拒绝

拒绝收到的好友邀请。拒绝后，将不会与对方建立好友关系。

```csharp
var response = await nc.rejectFriend(friendId);
```

* **friendId**: 要拒绝的好友邀请的用户标识符。

## 删除

从好友列表中删除特定用户。此操作可以在不考虑好友状态或邀请状态的情况下进行。

```csharp
var response = await nc.removeFriend(friendId);
```

* **friendId**: 要删除的好友的用户标识符。

好友管理功能在促进用户之间的互动和增强社交网络方面发挥着重要作用。通过这一功能，用户可以更轻松地扩展和管理自己的社交网络。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gamechat.me/basics/game-chat-v3/game-chat-zhong-wen/kai-shi-shi-yong-v3/hao-you.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
