$let

Declares and creates a temporary variable.

Temporary variables store data that can be used later in the code and are deleted once the code is executed.

Usage

$let[variableName;variableValue]

This function has two params.

ParamDescriptionTypeRequired

variableName

The name of this variable.

String

Yes

variableValue

The value that this variable holds.

String

Yes

Example

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]]`
})
  • $get[] - Gets the currency value of a temporary variable.

  • $delete[] - Deletes the provided temporary variable, so it can no longer be used in the code.

Last updated