# $setModuleSetting

`$setModuleSetting` **changes a server setting of a module**, after checking the value against what the module declares.

## Syntax

```
$setModuleSetting[id;key;value]
```

## Parameters

| Parameter | Description |
|---|---|
| `id` | Required. The identifier of the module. |
| `key` | Required. The key of the setting. |
| `value` | Required. The new value. Empty clears the setting (the default applies again). |

## Return value

- **Type**: String
- Always empty.

## JavaScript

`await bc.module.setSetting(id, key, value)`.

## Behavior

- The person who used the command or the button must have the **Manage Server** permission, otherwise the call fails with `You need the Manage Server permission to change module settings.`
- It only works inside an interaction (a slash command, a button, a menu or a modal): a scheduled task or an event is refused.
- Numbers are checked against the minimum and the maximum, choices against the list, toggles accept `true`/`false`, `on`/`off`, `yes`/`no` and `1`/`0`, channels and roles accept an ID or a mention.
- Only server settings change. Features and texts belong to the whole bot and stay in the app and the Studio.

## Examples

```bdfd
$onlyIf[$moduleInfo[tickets;installed]==true;Tickets is not installed.]
$setModuleSetting[tickets;max-open;$message[count]]
Done: $moduleSetting[tickets;max-open] tickets at most.
```

## Notes

- Everything is read from the modules installed on the bot, so a module added later is covered with no change to your script.
- See the guide [Module and command functions](/docs/module-functions/).
