> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSChatPresence

> Represents presence information for a chat user, bundled with some other useful information. Carrier object for ChatPresence.

Represents presence information for a chat user, bundled with some other useful information. Carrier object for ChatPresence.

## Constructors

### NSChatPresence()

```crmscript theme={null}
NSChatPresence
```

Initializes a new instance of the NSChatPresence class.

## Methods

## GetChatTopics()

```crmscript theme={null}
Integer[] GetChatTopics()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer)\[] - An array of IDs with chat topics that this user is a member of.

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer[] chatTopics = thing.GetChatTopics();
```

## GetDisplayName()

```crmscript theme={null}
String GetDisplayName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The display name of the chat user.

**Example:**

```crmscript theme={null}
NSChatPresence thing;
String displayName = thing.GetDisplayName();
```

## GetOngoingChats()

```crmscript theme={null}
Integer GetOngoingChats()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The number of ongoing chats this users has now.

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer ongoingChats = thing.GetOngoingChats();
```

## GetPresent()

```crmscript theme={null}
Bool GetPresent()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Indicates if the user has the chat presence turned on or off.

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Bool present = thing.GetPresent();
```

## GetUserId()

```crmscript theme={null}
Integer GetUserId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID for the chat user.

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer userId = thing.GetUserId();
```

## SetChatTopics(Integer\[])

```crmscript theme={null}
Void SetChatTopics(Integer[] chatTopics)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer[] chatTopics;
thing.SetChatTopics(chatTopics);
```

## SetDisplayName(String)

```crmscript theme={null}
Void SetDisplayName(String displayName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatPresence thing;
String displayName;
thing.SetDisplayName(displayName);
```

## SetOngoingChats(Integer)

```crmscript theme={null}
Void SetOngoingChats(Integer ongoingChats)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer ongoingChats;
thing.SetOngoingChats(ongoingChats);
```

## SetPresent(Bool)

```crmscript theme={null}
Void SetPresent(Bool present)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Bool present;
thing.SetPresent(present);
```

## SetUserId(Integer)

```crmscript theme={null}
Void SetUserId(Integer userId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatPresence thing;
Integer userId;
thing.SetUserId(userId);
```


## Related topics

- [NSChatAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSChatAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [Save Chat Presence](/en/api/reference/restful/agent/chat_agent/save-chat-presence.md)
- [Get Chat Presence](/en/api/reference/restful/rest/chatpresence/get-chat-presence.md)
