Skip to main content

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 coins might have 250 inside.
  • The box called favourite_colour might have blue inside.
  • The box called level might have 7 inside.
Your bot can read the box (to show it in a message), change the box (to give someone more coins) and check the box (to see if someone has enough coins to buy something).

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:
The bot sends:

Read these pages in order

  1. The Database page: where your variables live.
  2. Make your first variable: a step by step guide.
  3. Types of variables: numbers, text, users and more.
  4. Server or Global: who shares the same box.
  5. Show a variable in a message: curly brackets, keys and backups.
  6. Change a variable with blocks: add coins, take coins, reset.
  7. Objects and Collections: boxes with smaller boxes inside.
  8. Run-only values: boxes that only last for one run.
  9. Built-in variables: values DogeBot fills in for you.
  10. 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.