# Variables

Variables are dynamic placeholders that get replaced with real data when a message is sent. Use them in your welcomer messages and level-up announcements.

***

## Guild Variables

Available in: **Welcome**, **Leave**, **Join DM**, **Level-Up**

| Variable          | Description                | Example Output                   |
| ----------------- | -------------------------- | -------------------------------- |
| `{guild_name}`    | Server name                | My Server                        |
| `{guild_avatar}`  | Server icon URL            | <https://cdn.discordapp.com/>... |
| `{guild_count}`   | Total member count         | 1,234                            |
| `{server_name}`   | Alias for `{guild_name}`   | My Server                        |
| `{server_avatar}` | Alias for `{guild_avatar}` | <https://cdn.discordapp.com/>... |
| `{server_count}`  | Alias for `{guild_count}`  | 1,234                            |

***

## Member Variables

Available in: **Welcome**, **Leave**, **Join DM**, **Level-Up**

| Variable                 | Description             | Example Output                   |
| ------------------------ | ----------------------- | -------------------------------- |
| `{member}`               | Name and discriminator  | Alex#0001                        |
| `{member_name}`          | Username                | Alex                             |
| `{member_display_name}`  | Display name (nickname) | Alex                             |
| `{member_id}`            | Discord ID              | 123456789012345678               |
| `{member_discriminator}` | Discriminator           | 0001                             |
| `{member_mention}`       | Mention (clickable)     | @Alex                            |
| `{member_avatar}`        | Profile picture URL     | <https://cdn.discordapp.com/>... |

### Account Creation Timestamps

| Variable             | Format          | Example Output                    |
| -------------------- | --------------- | --------------------------------- |
| `{member_created:R}` | Relative time   | 2 months ago                      |
| `{member_created:F}` | Long date/time  | Monday, January 15, 2024 12:00 PM |
| `{member_created:f}` | Short date/time | January 15, 2024 12:00 PM         |
| `{member_created:d}` | Short date      | 01/15/2024                        |

***

## Inviter Variables

Available in: **Welcome**, **Leave**, **Join DM** (not available in level-up messages)

| Variable                    | Description             | Example Output                   |
| --------------------------- | ----------------------- | -------------------------------- |
| `{inviter}`                 | Name and discriminator  | John#0002                        |
| `{inviter_name}`            | Username                | John                             |
| `{inviter_display_name}`    | Display name (nickname) | John                             |
| `{inviter_id}`              | Discord ID              | 987654321098765432               |
| `{inviter_discriminator}`   | Discriminator           | 0002                             |
| `{inviter_mention}`         | Mention (clickable)     | @John                            |
| `{inviter_avatar}`          | Profile picture URL     | <https://cdn.discordapp.com/>... |
| `{inviter_invites}`         | Total invite count      | 42                               |
| `{inviter_regular_invites}` | Regular invite count    | 35                               |
| `{inviter_leave_invites}`   | Leave invite count      | 5                                |
| `{inviter_bonus_invites}`   | Bonus invite count      | 15                               |
| `{inviter_fakes_invites}`   | Fake invite count       | 3                                |

### Inviter Account Creation Timestamps

| Variable              | Format          | Example Output                 |
| --------------------- | --------------- | ------------------------------ |
| `{inviter_created:R}` | Relative time   | 1 year ago                     |
| `{inviter_created:F}` | Long date/time  | Monday, March 10, 2023 3:00 PM |
| `{inviter_created:f}` | Short date/time | March 10, 2023 3:00 PM         |
| `{inviter_created:d}` | Short date      | 03/10/2023                     |

***

## Invite Variables

Available in: **Welcome only** (not available in leave, join DM, or level-up)

| Variable        | Description                         | Example Output              |
| --------------- | ----------------------------------- | --------------------------- |
| `{invite_code}` | The invite code used                | abc123                      |
| `{invite_uses}` | Number of times the invite was used | 15                          |
| `{invite_url}`  | Full invite URL                     | <https://discord.gg/abc123> |

***

## Level-Up Variables

Available in: **Level-up announcements only**

| Variable           | Description                  | Example Output |
| ------------------ | ---------------------------- | -------------- |
| `{level}`          | Current level                | 5              |
| `{next_level}`     | Next level (current + 1)     | 6              |
| `{previous_level}` | Previous level (current - 1) | 4              |

{% hint style="info" %}
Level-up messages also have access to all [Member Variables](#member-variables) and [Guild Variables](#guild-variables).
{% endhint %}

***

## Utility Variables

Available in: **Welcome**, **Leave**, **Join DM**

| Variable          | Description      | Example Output |
| ----------------- | ---------------- | -------------- |
| `{random_color}`  | Random hex color | #800080        |
| `{random_letter}` | Random letter    | K              |

***

## Usage Example

```
Welcome {member_mention} to **{guild_name}**! 🎉
You were invited by **{inviter}** who now has **{inviter_invites}** invites.
Your account was created {member_created:R}.
You joined using invite `{invite_code}` ({invite_uses} uses).
We are now **{guild_count}** members!
```

{% hint style="warning" %}
**Important:** Inviter variables will show as empty or an error if used in the `unknown`, `vanity`, or `bot` message types, since no inviter information is available. Always set up separate messages for each type.
{% 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.invite-count.xyz/reference/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.
