> For the complete documentation index, see [llms.txt](https://docs.botwiz.dev/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.botwiz.dev/docs/creations/variables/interaction-and-default-variables.md).

# Interaction & Default Variables

This is the list of basic variables that are supported at BotWiz.

Basic variables consist of regular/most commonly used variables such as: {interaction} or {channel}. These are usable with any event or command interaction.

&#x20;Below you can find a full list of basic variables.

| Variable      | Use Case                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| {interaction} | Returns the interaction object for the command, button or select menu trigger. This includes the Member, User, Channel, and Guild objects. |

{% hint style="warning" %}
When using the {interaction} variable, please note that every button, select menu and modal click will change the value of the variable.  This results in the interaction data being overwritten with new data for the newly created interaction.
{% endhint %}

### Interaction Examples

{% tabs %}
{% tab title="Member" %}
You can find the full list of member properties[ here](https://discord.js.org/docs/packages/discord.js/14.15.3/GuildMember:Class).

<table data-full-width="false"><thead><tr><th>Variable</th><th>Example</th><th>Use case</th></tr></thead><tbody><tr><td><code>[member.displayName]</code></td><td>Jamie</td><td>Returns the user's displayName in the server the interaction was used in.</td></tr><tr><td><code>[member.id]</code></td><td>718039190935306351</td><td>Returns the ID of the user who used the interaction.</td></tr></tbody></table>
{% endtab %}

{% tab title="Channel" %}
You can find the full list of channel properties [here](https://discord.js.org/docs/packages/discord.js/14.15.3/GuildChannel:Class).

| Variable             | Example             | Use Case                                                            |
| -------------------- | ------------------- | ------------------------------------------------------------------- |
| `[channel.parentId]` | 1161086203890778192 | Returns the category ID of the channel the interaction was used in. |
| `[channel.name]`     | 💬┃general          | Returns the channel name that the interaction was used in.          |
| `[channel.id]`       | 1161086224690315365 | Returns the channel ID that the interaction was used in.            |
| {% endtab %}         |                     |                                                                     |

{% tab title="Guild" %}
You can find the full list of Guild properties [here](https://discord.js.org/docs/packages/discord.js/14.15.3/Guild:Class).

| Variable            | Example                                                        | Use Case                                                         |
| ------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------- |
| `[guild.name]`      | BotWiz.dev                                                     | Returns the name of the server that the interaction was used in. |
| `[guild.createdAt]` | Mon Jul 08 2024 12:35:06 GMT+0000 (Coordinated Universal Time) | Returns the date the server was created at.                      |
| `[guild.id]`        | 856011486077255690                                             | Returns the ID of the server where the interaction was used.     |
| {% endtab %}        |                                                                |                                                                  |
| {% endtabs %}       |                                                                |                                                                  |

{% hint style="info" %}
To use properties within the **Interaction** variable you will need to use the following format:

```
{interaction[]}
```

{% endhint %}

### Default Variable Examples

These variables allow quick access to Discord objects. It returns the complete Discord object, with the exception of the `{bot}` variable, which has been modified to exclude the token for security purposes.&#x20;

{% hint style="info" %}
Each variable also gives you the option to target a specific object, not just the default object. An example of how to get a members display name would be:

```
{member[MEMBER_ID][displayName]}
```

{% endhint %}

{% hint style="warning" %}
All variables have an optional ID option, except for the role variable.
{% endhint %}

<table><thead><tr><th width="165">Variable</th><th width="315">Default Return</th><th width="160" data-type="checkbox">Allows Target ID</th><th data-type="checkbox">Requires ID</th></tr></thead><tbody><tr><td>{user}</td><td>The user mention of the executor of that command or event. &#x3C;@USER_ID></td><td>true</td><td>false</td></tr><tr><td>{member}</td><td>The member mention of the executor of that command or event. &#x3C;@MEMBER_ID></td><td>true</td><td>false</td></tr><tr><td>{guild}</td><td>The guild name of the guild that the event or command was executed in.</td><td>true</td><td>false</td></tr><tr><td>{channel}</td><td>The channel mention of the channel that the event or command was executed in. &#x3C;#CHANNEL_ID></td><td>true</td><td>false</td></tr><tr><td>{bot}</td><td>The bot id of your bot.</td><td>true</td><td>false</td></tr><tr><td>{role[ROLE_ID]}</td><td>The role id of a specified role in the guild the command or event was executed in.</td><td>true</td><td>true</td></tr></tbody></table>
