$var

Creates a temporary variable.

Unlike, it's counterpart variables (i.e $setVar, $setUserVar etc.) which needs you to create a variable in the app, $var[] doesn't require you to do that. Instead, it creates the variable automatically during it's runtime and gets deleted 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.

📌 This function can only be used in BDScript 2 script language.

Syntax

$var[Name;(Value)]

Parameters

  • Name : The name of the temporary variable.
  • Value : The data to store (Optional).

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

Example

$nomention
$argsCheck[>1;Type a message!]

$var[ID;$sendMessage[$toLowercase[$message];yes]]

$addButton[no;interactionID;Example;secondary;;;$var[ID]]

Example