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

# Make a variable

> Where to make your own variables, and what every choice means.

There are **three places** to make a variable. They all make the same thing, so use whichever is easiest.

| Where | Best for |
| - | - |
| **Database** page, **What do you want to make?** tab | The quickest way. One click makes everything an idea needs. |
| **Database** page, **Start from scratch** tab | Making exactly what you want. |
| Inside the builder, the `{ }` tab | Making one while you're building a command. |

**Way 1: pick a ready idea**

The easiest way.

**1. Open the Database page**

In the menu on the left, under **Data and links**, click **Database**.

**2. Open What do you want to make?**

Click the **What do you want to make?** tab. You'll see ideas grouped into **Economy**, **Levels**, **Moderation**, **Tickets**, **Games** and **Server**.

**3. Press + Add**

Find the idea you want, like **Coins** or **Warnings**, and press **+ Add**. DogeBot makes the variables for you, already set up the right way. It says **Added** when it's done.

![The What do you want to make? tab with ready ideas](https://mintcdn.com/doge-bot/0C6-zgXTpDx1QOCe/images/guide/ds-ideas.png?fit=max\&auto=format\&n=0C6-zgXTpDx1QOCe\&q=85\&s=fcf1a40a32721b559641fdeac7e6fae0)

> [!NOTE]
>
> If you already have a variable with the same name, DogeBot keeps yours and doesn't change it.

**Way 2: start from scratch**

Click the **Start from scratch** tab on the Database page. You answer four questions, then press **Add Custom Variable**.

![The Start from scratch form on the Database page](https://mintcdn.com/doge-bot/0C6-zgXTpDx1QOCe/images/guide/ds-start-from-scratch.png?fit=max\&auto=format\&n=0C6-zgXTpDx1QOCe\&q=85\&s=638510a1ec76645ba0cbcc8750456bdb)

See [The four questions](#the-four-questions) below for what each one means.

**Way 3: in the builder**

Handy when you are in the middle of building a command and notice you need a new box.

**1. Open the variables tab**

On the thin bar on the far left of the builder, click the `{ }` icon. You'll see every variable your bot has.

**2. Press Create New Variable**

The big gold button at the top.

**3. Fill in the boxes**

* **Name**: what it's called, like `coins`.
* **Reference**: the tag, filled in for you, like `{DBVAR_coins}`.
* **Variable Type**: Text, Number, True/False, User, Channel, Collection or Object.
* **Default Value**: the starting value.
* **Scope**: Server Specific or Global.

Save it, and it's ready to use in any block.

![The Create New Variable window in the builder](https://mintcdn.com/doge-bot/0C6-zgXTpDx1QOCe/images/guide/create-variable.png?fit=max\&auto=format\&n=0C6-zgXTpDx1QOCe\&q=85\&s=0674c0f886977ef4f6a4a819de6ea1f5)

> [!TIP]
>
> Variables made in the builder show up on the Database page too, and the other way round. It's all one list.

## The four questions

### 1. Name

Give it a short name that says what it holds, like `coins` or `last-daily`. Use small letters. Spaces turn into dashes by themselves.

Under the name you'll see the **tag**, like `{DBVAR_coins}`. That's what you type in blocks to use it.

### 2. What does it hold?

This is the **type**. It decides what you can do with the box. You can only do maths on a **Number**, for example.

| Type | What goes in it | Example |
| - | - | - |
| **Text** | Words, or anything else | `Hello!` |
| **Number** | Counts, scores, money | `250` |
| **True / False** | On or off, like a light switch | `true` |
| **User** | A **different value for every member** | Each person's coins, XP or warnings |
| **Channel** | A different value for every channel | Message count per channel |
| **Collection** | A list of things | A shop, a backpack, a list of bad words |
| **Object** | Named keys, like a settings card | `prefix`, `color`, `log-channel` |

> [!TIP]
>
> **The most important one is User.** If every member should have their own amount (coins, XP, warnings, levels), pick **User**. Then pick what each member stores: a number for coins, text for a birthday, and so on.

#### Why User matters

If you make a **Number** variable called `coins`, there is **one** box. If Sam gets 100 coins, then **everyone** has 100 coins, because they all share one box.

If you make a **User** variable called `coins`, **every member gets their own box**. Sam's box can have 250 and Alex's box can have 90.

| User variable that stores... | Good for |
| - | - |
| **Number** | Coins, XP, levels, warnings |
| **Text** | A bio, a birthday, a favourite colour |
| **True / False** | "Has verified", "has claimed the starter pack" |
| **Object** | A full profile with coins, gems and level together. See [Lists and objects](/variables/lists-objects-and-members). |

#### Which type should I pick?

**1. Does every person need their own value?**

Pick **User**, then pick what they store.

**2. Will I do maths with it?**

Pick **Number**.

**3. Is it just on or off?**

Pick **True / False**.

**4. Is it a list of things?**

Pick **Collection**.

**5. Does it have many named parts?**

Pick **Object**.

**6. None of the above?**

Pick **Text**.

> [!WARNING]
>
> You cannot do maths on a Text variable, even if it has a number in it. If you want to add and take away, always use **Number**.

### 3. Where is it kept?

| Choice | What it means |
| - | - |
| **Server Specific** | Every Discord server gets its own copy. Your coins in Server A are different from your coins in Server B. This is what you want most of the time. |
| **Global** | One value shared everywhere, in every server your bot is in. Good for things like global coins. |

Not sure? Pick **Server Specific**. See [Server Specific or Global](/variables/server-specific-or-global).

### 4. Starting value

What's in the box before anything is saved. For coins, put `0`. If you leave it empty, the box starts empty.

For **Object** variables (and User variables that store an Object) you can add **Starting properties**: the named values every new entry begins with. See [Lists and objects](/variables/lists-objects-and-members).

Press **Add Custom Variable** and you're done.

## Example: a coins variable

> **Every member starts with 0 coins**
>
> * **Name:** `coins`
> * **Type:** **User**, and each member stores a **Number**
> * **Scope:** **Server Specific**
> * **Starting value:** `0`
>
> Now `{DBVAR_coins}` means "the coins of the person using the command".

## How many can I make?

Free bots can make **10** custom variables. Premium raises this. You can see how many you have at the top of the Database page. See [Premium and plans](/premium-and-plans).

## Next

Now learn how to [use your variable in blocks](/variables/use-your-variables-in-blocks).


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