# Guide — Module and command functions

These functions read the **real** state of the bot: the modules installed on it, what each one lets a server change, and the commands it has. Nothing is written in your script, so the answer is always current, and a module added later is covered with no change.

| What you want | BibiScript | JavaScript |
|---|---|---|
| The installed modules | `$moduleList[separator;filter;format]`, `$moduleCount[filter]` | `bc.module.list({filter, format})`, `bc.module.count(filter)` |
| One module | `$moduleInfo[id;field;separator]` | `bc.module.info(id, field)` |
| A feature of a module | `$moduleFeature[id;feature;field;separator]` | `bc.module.feature(id, feature, field)` |
| A server setting | `$moduleSetting[id;key;field;separator;guildID]` | `await bc.module.setting(id, key, field, guildId)` |
| Change a server setting | `$setModuleSetting[id;key;value]` | `await bc.module.setSetting(id, key, value)` |
| The commands | `$commandList[separator;filter]` | `bc.command.list({filter})` |
| One command | `$commandInfo[name;field;separator]` | `bc.command.info(name, field)` |

## A help command that never goes stale

```bdfd
$addContainer[;#5865F2]
$addTextDisplay[## Help]
$addSeparator[true;small]
$addTextDisplay[$moduleList[\n;all;name]]
```

## Changing a setting

A setting is stored in the server variable `mod_<module>_<key>`, so `$getGuildVar` reads it too. To **change** it, use `$setModuleSetting`: it checks the value against the module (type, minimum, maximum, choices), and the person must have the **Manage Server** permission. It only works inside an interaction, never in a scheduled task or an event.

Features (turning a part of a module on or off) and texts belong to the whole bot, not to one server: they stay in the app and the Studio.

## Languages

Names, labels, descriptions and command descriptions follow the language of the person who used the command, then the default language of the bot, then English.
