# 友達

## 友達管理 <a href="#undefined" id="undefined"></a>

Game Chatは友達を招待して管理する機能を提供し、ユーザー間のソーシャルネットワーキングを容易にします。このシステムにより、ユーザーは友達の招待、承諾、拒否、削除など、様々な友達管理を行うことができます。以下は、友達管理機能の主な詳細と各機能の使用方法です。

## 友達リスト <a href="#undefined" id="undefined"></a>

ユーザーの友達リストを照会でき、特定のステータスの友達のみフィルタリングして照会することもできます。リストはページングオプションで管理されるため、多数のユーザーを効果的に管理できます。

```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`はページごとに返す項目数です。

## 招待 <a href="#undefined" id="undefined"></a>

特定のユーザーを友達に招待します。招待されたユーザーは、このリクエストを承諾または拒否できます。

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

* **friendId** : 招待したいユーザーの識別子です。

## 承諾 <a href="#undefined" id="undefined"></a>

受け取った友達の招待を承諾します。これにより、二人のユーザーは相互に友達関係になります。

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

* **friendId** : 承諾する友達招待のユーザー識別子です。

## リジェクト <a href="#undefined" id="undefined"></a>

受け取った友達の招待を拒否します。このリクエストを拒否すると、相手と友達関係が成立しません。

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

* **friendId** : 拒否する友達招待のユーザー識別子です。

## 削除 <a href="#undefined" id="undefined"></a>

友達リストから特定のユーザーを削除します。このタスクは、友達や招待のステータスに関係なく行えます。

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

* **friendId** : 削除する友達のユーザー識別子です。

友達管理機能は、ユーザー間の相互作用を促進し、ネットワーキングを強化する上で重要な役割を果たします。この機能により、ユーザーは自分のソーシャルネットワークをより簡単に拡張して管理できます。

<br>


---

# 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-ri-ben-yu/v3nowo/you-da.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.
