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

# What is a variable?

> A variable is a box with a name, where your bot keeps something to remember.

Imagine a **box with a name written on it**. You can put something in the box, look inside it later, or swap what's inside. That's a **variable**.

Your bot uses variables to **remember things**. Without them, your bot forgets everything the moment a command finishes. It can say "Hello!", but it can never say "Hello, you have 250 coins!" because it does not remember any coins.

## Some examples

| Box name | What's inside | What it's for |
| - | - | - |
| `coins` | `250` | How many coins someone has |
| `level` | `7` | Someone's level |
| `warnings` | `2` | How many times someone was warned |
| `welcome-channel` | `1234567890` | Which channel to say hello in |
| `shop` | a list of items | Things people can buy |

Your bot can **read** a box (to show it in a message), **change** a box (to give someone more coins) and **check** a box (to see if someone has enough coins to buy something).

## Three kinds of variables

DogeBot has three kinds. They all use curly brackets, like `{this}`.

**1. Built-in variables**

Ready-made. You don't make these, they're always there. For example `{user_name}` is the name of the person who used the command, and `{server}` is the server name.

See [Built-in variables](/variables/built-in-variables).

**2. Your own variables (custom variables)**

You make these yourself, and the bot **remembers them forever**, even when it restarts. They always start with `DBVAR_`, like `{DBVAR_coins}`.

See [Make a variable](/variables/make-your-own-variables).

**3. Short-lived values**

Some blocks make a value that only lasts while the command is running. For example a command input called `amount` gives you `{option_amount}`, and a **Temporary value** block gives you `{whatever-you-named-it}`. When the command ends, they're gone.

See [Short-lived values](/variables/short-lived-values).

## How the bot uses them

When your bot runs a block, it first looks for anything in curly brackets and **swaps it for what's in the box**. So this:

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

turns into this in Discord:

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

> [!WARNING]
>
> **See `{something}` in Discord, with the brackets still there?** The bot couldn't find that variable. Usually it's a spelling mistake. Check the name carefully, capital letters matter. See [Find and fix variable problems](/variables/find-and-fix-variable-problems).

## What next?

> **[Make a variable](/variables/make-your-own-variables)**
>
> Step by step.

> **[Use variables in blocks](/variables/use-your-variables-in-blocks)**
>
> Save, add, take away and show them.

> **[Lists and objects](/variables/lists-objects-and-members)**
>
> Shops, backpacks and settings.

> **[Daily coins](/build-real-systems/daily-coins)**
>
> A full example that uses variables.


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