What is a variable?
Imagine a box with a name written on it. You can put something inside the box, look inside it later, or swap what is inside for something new. A variable is exactly that: a box with a name, and a value inside it.- The box called
coinsmight have250inside. - The box called
favourite_colourmight haveblueinside. - The box called
levelmight have7inside.
Why do I need variables?
Without variables your bot forgets everything the moment it finishes. It can say “Hello!”, but it can never say “Hello, you have 250 coins!” because it does not remember any coins. With variables, your bot can have:- money and shops (an economy)
- XP and levels
- counters, like “you are the 512th person to verify”
- settings, like “which channel is the log channel?”
- anything else you want it to remember
The three kinds of values
Easy way to remember: if the name starts with
DBVAR_, it is one of your own saved boxes. DB stands for database, the place where DogeBot keeps your boxes safe.How you write a variable
You always write a variable inside curly brackets{ }. When the bot sends the message, it swaps the brackets for what is inside the box.
You write:
Read these pages in order
- The Database page: where your variables live.
- Make your first variable: a step by step guide.
- Types of variables: numbers, text, users and more.
- Server or Global: who shares the same box.
- Show a variable in a message: curly brackets, keys and backups.
- Change a variable with blocks: add coins, take coins, reset.
- Objects and Collections: boxes with smaller boxes inside.
- Run-only values: boxes that only last for one run.
- Built-in variables: values DogeBot fills in for you.
- Check and fix your variables: see what is inside and find mistakes.
In this section
The Database page
The page where all your saved variables live.
Make your first variable
Make a coins variable, step by step.
Types of variables
Text, Number, True / False, User, Channel, Collection and Object.
Server or Global
Decide who shares the same box.
Show a variable in a message
Curly brackets, the insert button, keys and backup values.
Change a variable with blocks
Save a value, Do the maths, and clearing values.
Objects and Collections
Boxes with smaller boxes inside, and lists.
Run-only values
Values that only last while your command or event is running.
Built-in variables
Values DogeBot fills in for you, every time.
Check and fix your variables
See what is inside your boxes and find mistakes.
