Variables

Variables are how we store data in DBD.TS. Variables can be assigned to users, servers, channels, etc.

Creating a Variable

Template:

bot.addVariable({
  name: "name", //The name of this variable
  type: "TYPE", //The variable's type
  default: "defaultValue" //The default value of this variable (if no custom value is set from setVar)
})

Example:

bot.addVariable({
  name: "Money",
  type: "INTEGER",
  default: 0
})

Variable Types

  • TEXT - A string of characters.

  • INTEGER - A number without decimals.

  • FLOAT - A number with or without decimals.

Setting A Variable

$setVar[variable;value;id;type]

This function has four fields.

Getting a Variable's Value

$getVar[variable;id;type]

This function has three fields.

Last updated