> For the complete documentation index, see [llms.txt](https://docs.asagi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.asagi.xyz/other/message-templates/variables.md).

# Variables

## **User**

<table><thead><tr><th width="364">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ user.id }}</code></td><td>The unique identifier of the user</td></tr><tr><td><code>{{ user.username }}</code></td><td>The username of the user</td></tr><tr><td><code>{{ user.mention }}</code></td><td>A mention of the user, which can be used to notify them in a message</td></tr><tr><td><code>{{ user.avatarUrl }}</code></td><td>The URL of the user's avatar</td></tr><tr><td><code>{{ user.bannerColor }}</code></td><td>The color of the user's banner</td></tr><tr><td><code>{{ user.globalName }}</code></td><td>The global name of the user</td></tr></tbody></table>

{% hint style="info" %}
These variables can be used in the following modules: Automatic Moderation, Interactive Messages, Love Rooms, Notifications, Private Rooms.
{% endhint %}

{% hint style="warning" %}
For Love Rooms, use `user1` and `user2` variables.
{% endhint %}

## Member

<table><thead><tr><th width="389">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ member.nickname }}</code></td><td>The nickname of the member on the server</td></tr><tr><td><code>{{ member.displayName }}</code></td><td>The display name of the member, which is their nickname if they have one, or their username otherwise</td></tr><tr><td><code>{{ member.serverAvatarUrl }}</code></td><td>The URL of the member's server avatar</td></tr><tr><td><code>{{ member.roles.highest.name }}</code></td><td>The name of the member's highest role on the server</td></tr></tbody></table>

{% hint style="info" %}
These variables can be used in the following modules: Automatic Moderation, Interactive Messages, Love Rooms, Notifications, Private Rooms.
{% endhint %}

{% hint style="warning" %}
For Love Rooms, use `member1` and `member2` variables.
{% endhint %}

## **Guild**

| Variable                  | Description                               |
| ------------------------- | ----------------------------------------- |
| `{{ guild.id }}`          | The unique identifier of the server       |
| `{{ guild.name }}`        | The name of the server                    |
| `{{ guild.iconUrl }}`     | The URL of the server's icon              |
| `{{ guild.bannerUrl }}`   | The URL of the server's banner            |
| `{{ guild.memberCount }}` | The number of the members on the server   |
| `{{ guild.nameAcronym }}` | The abbreviated form of the server's name |
| `{{ guild.boostsCount }}` | The number of server boosts               |

{% hint style="info" %}
These variables can be used in the following modules: Automatic Moderation, Interactive Messages, Love Rooms, Notifications, Private Rooms, Starboard.
{% endhint %}

## Roles

<table><thead><tr><th width="363">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ roles.added }}</code></td><td>The roles that were added to the member</td></tr><tr><td><code>{{ roles.removed }}</code></td><td>The roles that were removed from the member</td></tr></tbody></table>

{% hint style="info" %}
These variables can be used only in the Interactive Messages module!
{% endhint %}

## **Timestamp**

<table><thead><tr><th width="388">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ timestamp.now }}</code></td><td>The current Unix timestamp</td></tr><tr><td><code>{{ timestamp.userCreatedAt }}</code></td><td>The Unix timestamp for the date and time when the user's account was created</td></tr><tr><td><code>{{ timestamp.memberJoinedAt }}</code></td><td>The Unix timestamp for the date and time when the member joined the server</td></tr><tr><td><code>{{ timestamp.guildCreatedAt }}</code></td><td>The Unix timestamp for the date and time when the server was created</td></tr></tbody></table>

{% hint style="info" %}
These variables can be used in the following modules: Automatic Moderation, Interactive Messages, Notifications.
{% endhint %}

## **Color**

<table><thead><tr><th width="314">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ color.default }}</code></td><td>The default color of the embed, set in the bot's configuration for system messages</td></tr><tr><td><code>{{ color.embed }}</code></td><td>The color of the embed, taken from the bot settings</td></tr><tr><td><code>{{ color.error }}</code></td><td>The error color of the embed, set in the bot's configuration for error messages</td></tr></tbody></table>

{% hint style="info" %}
These variables can be used in the following modules: Automatic Moderation, Interactive Messages, Notifications, Starboard.
{% endhint %}

## Handling Conditional Expressions with || and ? Operators

* `||`: This operator is used to handle expressions of the form `{{ identifier || 'default' }}`. If `identifier` is defined and not `null`, it is replaced with the corresponding value. If `identifier` is undefined or `null`, it is replaced with `'default'`.
* `?`: This operator is used to handle ternary expressions of the form `{{ identifier ? 'value if true' : 'value if false' }}`. If `identifier` is defined and not `null`, it is replaced with `'value if true'`. If `identifier` is undefined or `null`, it is replaced with `'value if false'`.

{% tabs %}
{% tab title="Examples with the || operator" %}

1. `{{ roles.added || 'No roles have been added.' }}`

<figure><img src="/files/82hcVk7tHD0bTunjRCvT" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Examples with the ? operator" %}

1. `{{ roles.added ? 'New roles have been added: {{ roles.added }}' : 'No roles have been added.' }}`

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

2. `{{ roles.added ? 'Role has been added: {{ roles.added }}' : '' }}{{ roles.removed ? 'Role has been removed: {{ roles.removed }}' : '' }}`

<figure><img src="/files/0mRaES1mMxkUhMqgQKWh" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

**Note:** You can use both single `'` and double quotes `"` for strings in these expressions. Additionally, it is possible to include variables inside these conditional expressions.
