> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dogebot.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> Make your bot remember things, like coins, levels and names.

## 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

| Kind | Who makes it | How long it lasts | Looks like |
| - | - | - | - |
| **Built-in values** | DogeBot fills them in for you. | Only while the command or event is running. | `{user_name}` |
| **Custom variables** | **You** make them on the Database page. | **Forever**, until you change or delete them. | `{DBVAR_coins}` |
| **Run-only values** | You make them with a block while the bot runs. | Only while that command or event is running. | `{my_value}` |

<Info>
  **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.
</Info>

## 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:

```text theme={null}
Hi {user_name}! You have {DBVAR_coins} coins.
```

The bot sends:

```text theme={null}
Hi Sam! You have 250 coins.
```

## Read these pages in order

1. [The Database page](/variables/the-database-page): where your variables live.
2. [Make your first variable](/variables/make-your-first-variable): a step by step guide.
3. [Types of variables](/variables/types-of-variables): numbers, text, users and more.
4. [Server or Global](/variables/server-or-global): who shares the same box.
5. [Show a variable in a message](/variables/show-a-variable-in-a-message): curly brackets, keys and backups.
6. [Change a variable with blocks](/variables/change-a-variable-with-blocks): add coins, take coins, reset.
7. [Objects and Collections](/variables/objects-and-collections): boxes with smaller boxes inside.
8. [Run-only values](/variables/run-only-values): boxes that only last for one run.
9. [Built-in variables](/variables/built-in-variables): values DogeBot fills in for you.
10. [Check and fix your variables](/variables/check-and-fix-your-variables): see what is inside and find mistakes.

## In this section

<Columns cols={2}>
  <Card title="The Database page" icon="table" href="/variables/the-database-page">
    The page where all your saved variables live.
  </Card>

  <Card title="Make your first variable" icon="circle-plus" href="/variables/make-your-first-variable">
    Make a coins variable, step by step.
  </Card>

  <Card title="Types of variables" icon="shapes" href="/variables/types-of-variables">
    Text, Number, True / False, User, Channel, Collection and Object.
  </Card>

  <Card title="Server or Global" icon="globe" href="/variables/server-or-global">
    Decide who shares the same box.
  </Card>

  <Card title="Show a variable in a message" icon="braces" href="/variables/show-a-variable-in-a-message">
    Curly brackets, the insert button, keys and backup values.
  </Card>

  <Card title="Change a variable with blocks" icon="calculator" href="/variables/change-a-variable-with-blocks">
    Save a value, Do the maths, and clearing values.
  </Card>

  <Card title="Objects and Collections" icon="boxes" href="/variables/objects-and-collections">
    Boxes with smaller boxes inside, and lists.
  </Card>

  <Card title="Run-only values" icon="timer" href="/variables/run-only-values">
    Values that only last while your command or event is running.
  </Card>

  <Card title="Built-in variables" icon="package" href="/variables/built-in-variables">
    Values DogeBot fills in for you, every time.
  </Card>

  <Card title="Check and fix your variables" icon="search-check" href="/variables/check-and-fix-your-variables">
    See what is inside your boxes and find mistakes.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.