> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet.eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet.eng/proud_service/proudchat/download/c.md).

# C\#

Download the ProudChat C# SDK from the link below.

## :open\_file\_folder: [C# ProudChat SDK](https://github.com/Nettention/ProudChatSDK/tree/main/ChatClientSDK/DotNet/ProudChat)

## Project settings

Add the <mark style="color:orange;">DotNetProudChat</mark> project file from the SDK folder you downloaded.

<figure><img src="/files/3uHD1fEojzi5ExBVTYDu" alt=""><figcaption></figcaption></figure>

In the root project, reference <mark style="color:orange;">DotNetProudChat</mark> by adding a project reference.

<figure><img src="/files/yFrMYTdt7IbQKFvsN6tT" alt=""><figcaption></figcaption></figure>

## ChatClient object

### - Creating

```csharp
Proud.ChatClient chatClient = new Proud.ChatClient();
```

### - ChatClient.Init

This is the part that initializes the ChatClient. The user must call the <mark style="color:orange;">Init</mark> function to connect to the server before using it.

<table data-full-width="false"><thead><tr><th width="160">Function Name</th><th>Parameters</th><th>Description</th></tr></thead><tbody><tr><td>Init</td><td>The user's UUID provided in the <a href="https://console.nettention.com"><strong>Proud Console</strong></a>, the UUID of a project created by the user, and the user's own UniqueID, Events to be called when Server Connection succeeds, events to be called when Server Login fails</td><td>You write this part of the function to connect the ChatClient with the server. As parameters, it takes a string to initialize the project (<mark style="color:orange;">authUUID</mark>,  <mark style="color:orange;">projectUUID</mark>, <mark style="color:orange;">uniqueID</mark>) and two events to check if the login succeeded or failed.</td></tr></tbody></table>

### - ChatClient.Disconnect

<table data-full-width="false"><thead><tr><th width="186">Function Name</th><th width="237">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>Disconnect</td><td>-</td><td>Use when you want to disconnect with the chat server.</td></tr></tbody></table>

### - ChatClient.FrameMove

The ChatClient has to call <mark style="color:orange;">FrameMove</mark> on Update all the time.

### - Function

<table data-full-width="false"><thead><tr><th width="204">Function Name</th><th width="317">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>IsConnected</td><td>-</td><td>Use when you check the status of server connection.</td></tr><tr><td>Join_Channel</td><td>Unique key for the channel you want to access</td><td>Use when you want to access a specific channel.</td></tr><tr><td>Leave_Channel</td><td>Unique key for the channel you want to leave</td><td>Use this when you want to leave the channel you're in.</td></tr><tr><td>Send_Direct_Msg</td><td>A unique identification value for a specific recipient, a message to send to the specific party</td><td>Use to send a message to a specific person.</td></tr><tr><td>Send_Channel_Msg</td><td>A unique identification value for a specific channel, a message to send to the specific channel</td><td>Use to send a message to a specific channel.</td></tr><tr><td>MsgTranslate</td><td><p>src = The country code of current language</p><p>target = The country code of the targeting language</p><p>msgKey = A unique key of message to translate</p><p>msg = A message to translate</p></td><td>(Beta) Use when you want to translate the message</td></tr><tr><td>MsgTranslate_Auto</td><td><p>target = The country code of the targeting language</p><p>msgKey = A unique key of message to translate </p><p>msg = A message to translate</p></td><td>(Beta) Request the translation of the message after automatically detecting the language.</td></tr><tr><td>MsgRecord_Channel</td><td>channelKey = A unique key of the channel<br>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the chat data from the Channel. <br>Retrieve up to 100 messages within the last 90 days.</td></tr><tr><td>MsgRecord_Direct</td><td>target = A unique key of the target user<br>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the data from the Direct messages.<br>Retrieve up to 100 messages within the last 90 days.</td></tr><tr><td>MsgRecord_Notice</td><td>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the data from the Notice.<br>Retrieve up to 100 messages within the last 90 days.</td></tr></tbody></table>

### - Event variable

<table data-full-width="false"><thead><tr><th width="290">Event variable name</th><th>Description</th></tr></thead><tbody><tr><td>chatClientJoinCompleteDelegate</td><td>Event fired when ChatClient completes <mark style="color:orange;">Init</mark> .</td></tr><tr><td>chatClientJoinFailedDelegate</td><td>Event fired when ChatClient <mark style="color:orange;">Init Failed</mark> occurs.</td></tr><tr><td>chatClientDisconnectDelegate</td><td>It will be called on server login failure.</td></tr><tr><td>channelMsg_ResponseDelegate</td><td>Event that delegates when a user sends a message in the channel.</td></tr><tr><td>directMsg_ResponseDelegate</td><td>Event that delegates when a user sends me a direct message.</td></tr><tr><td>notice_ResponseDelegate</td><td>Event that delegates when you send a <mark style="color:orange;">Notice</mark> from Proud Console.</td></tr><tr><td>channelJoinSuccessDelegate</td><td>It will be delegated upon <mark style="color:orange;">Channel Join Success</mark>.</td></tr><tr><td>channelJoinFailedDelegate</td><td>It will be delegated upon <mark style="color:orange;">Channel Join failed</mark>.</td></tr><tr><td>channelLeaveSuccessDelegate</td><td>It will be delegated upon <mark style="color:orange;">Channel Leave Success</mark>.</td></tr><tr><td>channelLeaveFailedDelegate</td><td>It will be delegated upon <mark style="color:orange;">Channel Leave failed</mark>.</td></tr><tr><td>msgTranslateSuccessDelegate</td><td>(Beta) It will be delegated once the message is successfully translated.</td></tr><tr><td>msgTranslateFailedDelegate</td><td>(Beta) It will be delegated once the message translation fails.</td></tr><tr><td>msgRecordSuccessDelegate</td><td>(Beta) It will be delegated once the data history is successfully retrieved.</td></tr><tr><td>msgRecordFailedDelegate</td><td>(Beta) It will be delegated once the data history retrieval fails.</td></tr></tbody></table>


---

# 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.proudnet.com/proudnet.eng/proud_service/proudchat/download/c.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.
