> For the complete documentation index, see [llms.txt](https://dbd-ts.gitbook.io/dbdts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dbd-ts.gitbook.io/dbdts/functions/let.md).

# $let

{% hint style="info" %}
Temporary variables store data that can be used later in the code and are deleted once the code is executed.
{% endhint %}

### Usage

```php
$let[variableName;variableValue]
```

This function has two params.

| Param         | Description                         | Type   | Required |
| ------------- | ----------------------------------- | ------ | -------- |
| variableName  | The name of this variable.          | String | Yes      |
| variableValue | The value that this variable holds. | String | Yes      |

### Example

```javascript
bot.commands.add({
  type: "basicCommand",
  name: "example",
  code: `$let[user;$mentioned[1]]
$description[1;<@$get[user]>]
$addField[1;ID;$get[user]]
$addField[1;Roles;$userRoles[$guildID;$get[user];yes;mention]]
$addField[1;Permissions;$userPerms[$guildID;$get[user];, ;yes]]`
})
```

### Related Functions

* [`$get[]`](https://github.com/Leref/dbd.ts-documentation/blob/master/src/functions/functions/get.md) - Gets the currency value of a temporary variable.
* [`$delete[]`](https://github.com/Leref/dbd.ts-documentation/blob/master/src/functions/functions/delete/md/README.md) - Deletes the provided temporary variable, so it can no longer be used in the code.
