> 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 %}

## Birthday

<table><thead><tr><th width="314">Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>{{ birthday.date }}</code></td><td>The member's birthday date, formatted according to the server language. The year is not included</td></tr><tr><td><code>{{ birthday.day }}</code></td><td>The day of the member's birthday</td></tr><tr><td><code>{{ birthday.month }}</code></td><td>The localized name of the member's birthday month</td></tr><tr><td><code>{{ birthday.monthNumber }}</code></td><td>The number of the member's birthday month, from <code>1</code> to <code>12</code></td></tr><tr><td><code>{{ birthday.timestamp }}</code></td><td>The Unix timestamp of the birthday occurrence, based on the server timezone</td></tr></tbody></table>

{% hint style="info" %}
Birthday variables are available in birthday-related message templates, including birthday messages and birthday reminders.
{% 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="https://3927572991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hy8ldYgZJ9GQJFAuYLR%2Fuploads%2FRh6VT9J6B4TyDt9dvFIJ%2FDiscord_9D3PbEIIuf.png?alt=media&amp;token=8a6bc8ec-8937-4592-8b13-c38a29c07293" 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="https://3927572991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hy8ldYgZJ9GQJFAuYLR%2Fuploads%2FOhPUmfNW3wrmZ0ushErs%2FDiscord_QnVqOtinxA.png?alt=media&amp;token=59466505-7f23-46cb-b6bd-5c99f4dd71bf" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3927572991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hy8ldYgZJ9GQJFAuYLR%2Fuploads%2FbOmVxhV31keBcm0woY2M%2FDiscord_5ilIZiPcET.png?alt=media&amp;token=d147a31a-1c7a-4379-aa30-97fcf0e984ec" 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.
