# Friendship

## Manage friends <a href="#undefined" id="undefined"></a>

Ncloud Chat provides functions of inviting and managing friends to facilitate social networking among users. Through this system, you can perform various friend management tasks such as inviting, accepting, refusing, and deleting friends. The following describes the main details of friend management features and how to use each function.

## Friend list <a href="#undefined" id="undefined"></a>

You can view the list of your friends and, by extension, filter and view friends in a specific status. The list is managed through paging options so that you can manage many users effectively.

```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**: filters based on the status of the friend you want to view (e.g., "accepted").
* **Sort**: sets the criteria to sort the results. Here, sorting in descending order is used based on the creation time.
* **Option**: sets the scope of data you want to view. `offset` specifies the location where the data starts, and `per_page` specifies the number of messages to be returned per page.

## Invite <a href="#undefined" id="undefined"></a>

Invites a certain friend as a friend. The user who is invited can accept or decline this request.

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

* **friendId**: identifier of the user you want to invite.

## Accept <a href="#undefined" id="undefined"></a>

Accepts the friend invitation you received. Through this, two users have a mutual friendship.

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

* **friendId**: user identifier of the friend invitation you want to accept.

## Reject <a href="#undefined" id="undefined"></a>

Rejects the friend invitation you received. When you reject the request, you can't have the other person as a friend.

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

* **friendId**: user identifier of the friend invitation you want to reject.

## Delete <a href="#undefined" id="undefined"></a>

Deletes a certain user from the friend list. This task might be performed regardless of friend status or invitation status.

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

* **friendId**: user identifier of the friend you want to delete.

The friend management features promote interaction among users, and has an important role in enhancing networking. Through this function, you can easily expand and manage your social network.


---

# 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-english/start-using-v3/friendship.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.
