Links

Data Storage

Custom Variables are the first step in unlocking the ability for your bot to be better used in multi-server settings. Read the docs page below for all the information!

Custom Variables

Custom Variables are the first step in unlocking the ability for your bot to be better used in multi-server settings. Custom variables allow you to store data to be used by your bot through creating custom Text, Number and User variables. You can then use these variables in custom command actions by using an associated {BGVAR_variable} variable. Custom Variables can be either global or server specific, allowing for different values based on the server they are used in.
Variable Name & Reference starting with {BGVAR_

Variable Types

Currently there are three variable types in this update. We plan to add more variable types such as Role, Channel and Member variables in the future.
Text & Number Variables: Text and number variables are the most basic variables you can create. They store a single value that is either global or server specific.
User Variables: Unlike basic text and number variables, user variables allow you to store and assign data to individual users in your server. This means that every user your bot interacts with, can have a different value for a variable. These variables can also be global or server specific.
Variable Type: Text, number & user / Default Value

Creating Variables & Usage

To create a custom variable head over to the newly created Data Storage module. This module not only allows to create custom variables, but will also show you how many times a variable has been used and how many items of that variable are currently being stored.
Usage: A new usage system is being implemented to track how custom variables are being used across your bots. This system uses a 'database calls' system as a unit of measurement.
​
​
Interacting or creating a variable will use 10 calls.

Storage 'Calls' available

Currently, free users have 1000 calls and members with any paid subscription have unlimited calls to use. Creating or interacting with a variable will use 10 calls. Calls for free users are reset at the start of every month.

Setting & Deleting Custom Variables

To set custom variables you can use either the new Set Variable or Run Equation on Variable custom command actions. Set Variable allows you to simply set a value for a custom variable. You can use options and normal variables when doing so. The Run Equation on Variable allows you to run any equation using the value of a custom variable.
Command Builder actions: Set Variable, Run Equation on Vaiable & Delete Variable
You can also delete a custom variable from storage.
Delete a variable

Using Variables

Default: To use variables you can copy paste the 'reference' that is shown when you create a custom variable. All custom variables begin with BGVAR and are simply the name of the variable converted to lower case. For example, 'Counter Variable' would be {BGVAR_counter_variable}. This variable can be used in any custom command action. Custom variables will be slowly deployed across all BotGhost modules. Default + user ID / option: You can display other peoples variables by using targeted variables. For instance to display my {BGVAR_counter_variable} you could do {BGVAR_counter_variable[136327647792726016]}. You can also use user options in place of a user id. If you had a user option named 'target' you could display a users Counter Variable by using {BGVAR_counter_variable[option_target]}.
Plain Text Reply with a custom variable, {BGVAR_exampe}
Experiencing issues with this module or do you just need help? Checkout our support options here!