# User settings

# Script User Settings

Most scripts are designed to be **configurable** by the user. These configurable options can include things like group names, custom messages, and other parameters.


:::info
**Note:** The user’s **bot name** is not a setting. The user selects which bot to use when purchasing your script.

:::

# Configuring Settings

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/baa413f5-0767-42fd-8cb4-3825420db602/Store-user-settings-1.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T141500Z&X-Amz-Expires=86400&X-Amz-Signature=c1592ba2c8f25f05bec38366be00ed81ab512302c7835a2809154f1e7a193e04&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

When defining user settings, you specify three values:


1. **Variable name** — how your script references the setting.
2. **Friendly name** — how the setting appears to the user.
3. **Optional hint** — a short description to help the user.


:::warning
All settings are stored as string values. If you need a number or UUID, you should convert it appropriately within your script.

:::

# Accessing User Settings from Script

User settings can be accessed via the global `userSettings` object:

```javascript
console.log("Using group: " + userSettings.group_name);
```

## Example: Setting Defaults

An easy way to define default values is by using `Object.assign()`.

```javascript
// Define the default settings here.
const defaultSettings = {
  greetingMessage: "Hello, welcome!",
  repeatCount: 2,
  enableLogging: false
};

// Merge defaults with any values provided by the user.
const settings = Object.assign({}, defaultSettings, userSettings);

// Access the settings.
console.log(settings.greetingMessage);
```

# Specifying Settings While Developing Scripts

While developing your script, you can specify custom test values for user settings on the **Settings** tab:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/6f6f1a71-3cd2-494f-aca2-8f6c21077641/Store-user-settings-2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T141500Z&X-Amz-Expires=86400&X-Amz-Signature=95a78aae2a050a6b63e233c94b8ea0fe45c50ec67acbc9c2743d5c55574b870f&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

New settings will automatically appear here after you add them on the **Bot Store → User Settings** screen.

# Asking the User for Settings

After purchasing the script, users see a configuration panel for their settings:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/1ee8a781-26b2-4932-9f8e-3c8788e7640d/Store-user-settings-3.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T141500Z&X-Amz-Expires=86400&X-Amz-Signature=87b1658503c9382735950e0f0ac9fb34b695a3850689ccaa47af4cd9fee2fb8e&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

# Settings and Releases

When you publish a new release, the list of settings is saved with that release. This means future changes to user settings won’t affect existing script versions:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/f52c4aa5-5a7b-422a-8f4f-c060bbe00cc0/Store-user-settings-4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T141500Z&X-Amz-Expires=86400&X-Amz-Signature=aaa78fb1828bea34b96e06364251ffb7faa2110ddacc8f0d018855a0215350f8&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =514x187")

You can safely rename, add, or remove settings when updating your script — previously purchased versions will continue to function normally.