> For the complete documentation index, see [llms.txt](https://docs.gamechat.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamechat.me/basics/game-chat-v3/game-chat-ri-ben-yu/v3nowo/ysuksu.md).

# ユースケース

## ユースケース

### Ncloudchat Reactのユースケース

GitHubには全ソースが公開されているため [GitHubソース](https://github.com/nbase-io/CloudChat-JS-Demo)をダウンロードでき、[https://www.ncloudchat.com](https://www.ncloudchat.com/)を通じて利用することができます。

### 全体サンプルコードのユースケース <a href="#undefined" id="undefined"></a>

アクセスしてチャンネルを作成し、そのチャンネルに登録メッセージを送信するユースケースです。

```csharp

// 初期化 
CloudChat nc = CloudChat.GetInstance();
await nc.initialize([PROJECT_ID]);
nc.dispatcher.onMessageReceived += e =>
{
    Console.WriteLine("received a new message: ", e);
};
await nc.Connect(
    userId: 'guest@company',
    name: 'Guest',
    profile: 'https://image_url',
    customField: 'json',
);
// チャンネル作成
var channel = await nc.createChannel(new CloudChatSDK.Channel
{
    name = "New Channel",
    type = "PUBLIC",    // PUBLIC or PRIVATE
    customField = "customField"
});
var channel = await nc.createChannel({type:'PUBLIC', name:'First Channel', customField:'customField'});
var channel_id = channel.createChannel.channel.id.ToString();
// チャンネル登録
await nc.subscribe(channel_id);
// メッセージ送信
var response = await nc.sendMessage(
        channelId: channel_id, 
        type:"text", 
        content: message
    );
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.gamechat.me/basics/game-chat-v3/game-chat-ri-ben-yu/v3nowo/ysuksu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
