> ## 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.

# NSChatBotSettings

> Chat topic bot settings. Trigger script ids to run on bot events. Carrier object for ChatBotSettings.

Chat topic bot settings. Trigger script ids to run on bot events. Carrier object for ChatBotSettings.

## Constructors

### NSChatBotSettings()

```crmscript theme={null}
NSChatBotSettings
```

Initializes a new instance of the NSChatBotSettings class.

## Methods

## GetBotMessageReceivedScriptId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Script ID to run when new messages received from customer.

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botMessageReceivedScriptId = thing.GetBotMessageReceivedScriptId();
```

## GetBotName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Chatbot name.

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
String botName = thing.GetBotName();
```

## GetBotRegisterScriptId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Script ID to register/unregister chatbot. 0 if there is no bot.

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botRegisterScriptId = thing.GetBotRegisterScriptId();
```

## GetBotSessionChangedScriptId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Script ID to run when session state changes.

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botSessionChangedScriptId = thing.GetBotSessionChangedScriptId();
```

## GetBotSessionCreatedScriptId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Script ID to run on new session.

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botSessionCreatedScriptId = thing.GetBotSessionCreatedScriptId();
```

## SetBotMessageReceivedScriptId(Integer)

```crmscript theme={null}
Void SetBotMessageReceivedScriptId(Integer botMessageReceivedScriptId)
```

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

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botMessageReceivedScriptId;
thing.SetBotMessageReceivedScriptId(botMessageReceivedScriptId);
```

## SetBotName(String)

```crmscript theme={null}
Void SetBotName(String botName)
```

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

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
String botName;
thing.SetBotName(botName);
```

## SetBotRegisterScriptId(Integer)

```crmscript theme={null}
Void SetBotRegisterScriptId(Integer botRegisterScriptId)
```

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

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botRegisterScriptId;
thing.SetBotRegisterScriptId(botRegisterScriptId);
```

## SetBotSessionChangedScriptId(Integer)

```crmscript theme={null}
Void SetBotSessionChangedScriptId(Integer botSessionChangedScriptId)
```

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

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botSessionChangedScriptId;
thing.SetBotSessionChangedScriptId(botSessionChangedScriptId);
```

## SetBotSessionCreatedScriptId(Integer)

```crmscript theme={null}
Void SetBotSessionCreatedScriptId(Integer botSessionCreatedScriptId)
```

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

**Example:**

```crmscript theme={null}
NSChatBotSettings thing;
Integer botSessionCreatedScriptId;
thing.SetBotSessionCreatedScriptId(botSessionCreatedScriptId);
```


## Related topics

- [NSChatTopicEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSChatTopicEntity.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [SuperOffice.WebApi.Data.ChatBotSettings](/en/api/reference/webapi/SuperOffice.WebApi.Data.ChatBotSettings.md)
- [SuperOffice.WebApi.Data.ChatTopicEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.ChatTopicEntity.md)
- [Chat sessions](/en/automation/chatbot/sessions.md)
- [Void](/en/automation/crmscript/reference/CRMScript.Global.Void.md)
