# Bot Variables

The Variables page allows you to create [custom variables](/docs/creations/variables/custom-variables.md) which can be used in any command, event or timed event on your bot.&#x20;

<figure><img src="/files/YBYP0eKndeysy4uApFLd" alt=""><figcaption></figcaption></figure>

BotWiz allows you to create multiple different types of variables each having its own unique purpose and plus points. Creating a variable is super easy, on the Bot Variables page, the first section on the page will allow you to create a custom variable.

You can customize the following options for the new custom variable:

* Name
* Type
* Default Value
* Scope

### Name

This input will allow you to pick a custom name for the variable which you will use to reference the variable to retrieve data from it. This can be done by entering: <mark style="color:red;">`{custom_[name]}`</mark> into any text input block on any command or event for the bot. **Ensure you replace&#x20;**<mark style="color:red;">**`[name]`**</mark>**&#x20;with the name you entered for the custom variable when creating it.**

### **Type**

| Option  | Information                                                                                                                                                                                                       |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Text    | Sets the variable to store a string, allowing it to accept any value, from numbers, letters or symbols.                                                                                                           |
| Number  | Sets the variable to store a number, allowing only numbers to be stored. This also allows the variable to be used in the [Calculate variable](/docs/blocks/actions/variable-actions/calculate-variable.md) block. |
| Channel | Sets the variable to work in a specific channel, this allows you to store data for a specific channel, rather than for the entire server.                                                                         |
| User    | Sets the variable to store values for a specific user.                                                                                                                                                            |
| Array   | Sets the variable to store an array / list of values, this allows you to store multiple values in separate positions.                                                                                             |

{% hint style="info" %}
When you select a channel, user or array type. It will then allow you to again specify if it is a user, or channel specific variable.
{% endhint %}

### Default Value

Setting a default value will make the variable start with the value specified in this input rather than starting as `null`. By setting it to 0 it would mean the users start off without a single warning and it will display 0 rather than `blank`.

### Scope

| Option | Information                                                                                                                                                                               |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Guild  | Sets the variable to store data in each guild the bot is in. This means you are only able to update that guilds data in said variable by using a command or event in that specific guild. |
| Global | Sets the variable to store data on a global basis. Meaning anytime the variable is updated, the changes will be reflected in all guilds the bot is in.                                    |

### Viewing existing variables

You can view all your existing custom variables at the bottom of the variables page.

<figure><img src="/files/4LxV2EjkVkhzW9wTNFm9" alt=""><figcaption><p>Image shows the variables page with existing variables.</p></figcaption></figure>

Clicking on one of the variables will allow you to edit or delete the variable. When editing, you can change everything about the variable as if you were re-making it.&#x20;

{% hint style="danger" %}
Once the variable is deleted, there is no way to get it or its data back. They are removed from our systems too.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.botwiz.dev/docs/creations/variables/custom-variables/bot-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
