$var

Creates a temporary variable.

Unlike its counterpart variables (e.g. $setVar, $setUserVar, etc.) which require you to create a variable in the app, $var[] doesn’t require that.

Instead, it creates the variable automatically during its runtime and deletes it once the command execution terminates.

The data stored in the temporary variable can only be retrieved during its execution period and is removed once it’s finished.

BDScript 2

Can only be used in BDScript 2.

Syntax

$var[Name;(Value)]

Parameters

  • Name (Type: String || Flag: Required): The name of the temporary variable.
  • Value (Type: String || Flag: Vacantable): The data to store.

Info

To retrieve the temporary stored value, type $var[Name], where “Name” is the temporary variable name.

Example

$nomention
$var[ID;$sendMessage[$toLowercase[$message];yes]]
$addButton[no;interactionID;Example;secondary;;;$var[ID]]

Example

Read more

For more information, read the Variables Guide.