> ## Documentation Index
> Fetch the complete documentation index at: https://docs.razebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> All variables available in raze for embed scripting and message templates.

# Variables

> All variables available in raze for embed scripting and message templates.

These variables are available throughout raze and can be used in any command context which contains a `message` or `embed code` parameter (e.g. `welcome`, `leave`, `level-up`, `invoke`).

## How to use variables

Variables let you inject dynamic text into your messages. For example, if you want a welcome message to ping the user and mention the server name, you can write:

```text theme={null} theme={null}
Welcome to {guild.name}, {user.mention}!
```

When a user named "wanderer" joins "raze", it outputs:

> Welcome to raze, @wanderer!

You can also use these variables in your Embed Builder or anywhere else that supports scripting. Just wrap the variable name in curly braces `{}`.

<AccordionGroup>
  <Accordion title="Guild">
    | Variable                          | Output                                                         |
    | --------------------------------- | -------------------------------------------------------------- |
    | `{guild.name}`                    | The guild's name                                               |
    | `{guild.id}`                      | The guild's ID                                                 |
    | `{guild.count}`                   | The guild's member count                                       |
    | `{guild.shard}`                   | The guild's shard ID                                           |
    | `{guild.owner_id}`                | The guild's owner ID                                           |
    | `{guild.created_at}`              | The guild's creation date (relative)                           |
    | `{guild.created_at_timestamp}`    | The guild's creation date in UNIX                              |
    | `{guild.emoji_count}`             | The guild's emoji count                                        |
    | `{guild.role_count}`              | The guild's role count                                         |
    | `{guild.boost_count}`             | The guild's boost count                                        |
    | `{guild.boost_tier}`              | The guild's boost tier, defaults to `No Level`                 |
    | `{guild.preferred_locale}`        | The guild's preferred locale                                   |
    | `{guild.key_features}`            | The guild's list of features (possibly `N/A`)                  |
    | `{guild.icon}`                    | The guild's icon URL (possibly `N/A`)                          |
    | `{guild.banner}`                  | The guild's banner URL (possibly `N/A`)                        |
    | `{guild.splash}`                  | The guild's splash URL (possibly `N/A`)                        |
    | `{guild.discovery}`               | The guild's discovery splash URL (possibly `N/A`)              |
    | `{guild.max_presences}`           | The guild's max presences amount                               |
    | `{guild.max_members}`             | The guild's max members amount                                 |
    | `{guild.max_video_channel_users}` | The guild's max video channel users                            |
    | `{guild.afk_timeout}`             | The guild's AFK timeout in seconds                             |
    | `{guild.afk_channel}`             | The guild's AFK channel name (possibly `N/A`)                  |
    | `{guild.channels}`                | The guild's total channel count                                |
    | `{guild.channels_count}`          | The guild's total channel count                                |
    | `{guild.text_channels}`           | The guild's text channel count                                 |
    | `{guild.text_channels_count}`     | The guild's text channel count                                 |
    | `{guild.voice_channels}`          | The guild's voice channel count                                |
    | `{guild.voice_channels_count}`    | The guild's voice channel count                                |
    | `{guild.category_channels}`       | The guild's category count                                     |
    | `{guild.category_channels_count}` | The guild's category count                                     |
    | `{guild.vanity}`                  | The guild's vanity URL (e.g. `/raze`)                          |
    | `{guild.owner}`                   | The guild owner's username                                     |
    | `{guild.owner.id}`                | The guild owner's ID                                           |
    | `{guild.owner.mention}`           | Mentions the guild owner                                       |
    | `{guild.owner.avatar}`            | The guild owner's avatar URL                                   |
    | `{tags}`                          | Number of members displaying the server's tag (guild identity) |
    | `{tag_count}`                     | Number of members displaying the server's tag (guild identity) |
  </Accordion>

  <Accordion title="User">
    | Variable                       | Output                                              |
    | ------------------------------ | --------------------------------------------------- |
    | `{user}`                       | The user's name and discriminator                   |
    | `{user.id}`                    | The user's ID                                       |
    | `{user.mention}`               | The user's mention                                  |
    | `{user.name}`                  | The user's username                                 |
    | `{user.tag}`                   | The user's discriminator                            |
    | `{user.avatar}`                | The user's profile picture                          |
    | `{user.guild_avatar}`          | The user's guild profile picture                    |
    | `{user.display_avatar}`        | The user's displayed profile picture                |
    | `{user.joined_at}`             | The user's guild join date (relative)               |
    | `{user.joined_at_timestamp}`   | The user's guild join date in UNIX                  |
    | `{user.created_at}`            | The user's account creation date (relative)         |
    | `{user.created_at_timestamp}`  | The user's account creation date in UNIX            |
    | `{user.display_name}`          | The user's current display name                     |
    | `{user.boost}`                 | `Yes`/`No` if the user is boosting the guild        |
    | `{user.boost_since}`           | The user's initial guild boost date (relative)      |
    | `{user.boost_since_timestamp}` | The user's initial guild boost date in UNIX         |
    | `{user.color}`                 | The user's top role hex code                        |
    | `{user.top_role}`              | The user's top role name, defaults to `N/A`         |
    | `{user.role_list}`             | The user's role list as mentions (possibly `N/A`)   |
    | `{user.role_text_list}`        | The user's role list as names (possibly `N/A`)      |
    | `{user.bot}`                   | `Yes`/`No` if the user is a bot                     |
    | `{user.badges_icons}`          | The user's profile badges as emoji (possibly `N/A`) |
    | `{user.badges}`                | The user's profile badges as text (possibly `N/A`)  |
    | `{user.join_position}`         | The user's join position                            |
    | `{user.join_position_suffix}`  | The user's join position with ordinal suffix        |
  </Accordion>

  <Accordion title="Channel">
    | Variable                   | Output                                       |
    | -------------------------- | -------------------------------------------- |
    | `{channel.name}`           | The channel's name                           |
    | `{channel.id}`             | The channel's ID                             |
    | `{channel.mention}`        | The channel's mention                        |
    | `{channel.topic}`          | The channel's topic (possibly `N/A`)         |
    | `{channel.type}`           | The channel's type (text, voice, etc.)       |
    | `{channel.category_id}`    | The channel's category ID (possibly `N/A`)   |
    | `{channel.category_name}`  | The channel's category name (possibly `N/A`) |
    | `{channel.position}`       | The channel's position in the channel list   |
    | `{channel.slowmode_delay}` | The channel's slowmode delay in seconds      |
  </Accordion>

  <Accordion title="Date & Time">
    All IST times are `Asia/Kolkata`. All UTC times are `UTC+0`.

    | Variable                  | Output                           |
    | ------------------------- | -------------------------------- |
    | `{date.now}`              | Current date in IST              |
    | `{date.now_proper}`       | Full formatted date in IST       |
    | `{date.now_short}`        | Short date in IST (`MM/DD/YYYY`) |
    | `{date.now_shorter}`      | Shorter date in IST (`MM/DD/YY`) |
    | `{time.now}`              | 12-hour time in IST              |
    | `{time.now_military}`     | 24-hour time in IST              |
    | `{date.utc_now}`          | Current date in UTC              |
    | `{date.utc_now_proper}`   | Full formatted date in UTC       |
    | `{date.utc_now_short}`    | Short date in UTC (`MM/DD/YYYY`) |
    | `{date.utc_now_shorter}`  | Shorter date in UTC (`MM/DD/YY`) |
    | `{time.utc_now}`          | 12-hour time in UTC              |
    | `{time.utc_now_military}` | 24-hour time in UTC              |
    | `{date.utc_timestamp}`    | Current UNIX timestamp           |
  </Accordion>

  <Accordion title="Invites">
    Available in welcome message templates when invite tracking is enabled.

    | Variable            | Output                               |
    | ------------------- | ------------------------------------ |
    | `{invites}`         | Total invite count of the inviter    |
    | `{inviter}`         | The inviter's name and discriminator |
    | `{inviter.mention}` | Mentions the inviter                 |
    | `{inviter.name}`    | The inviter's username               |
    | `{inviter.id}`      | The inviter's ID                     |
    | `{inviter.avatar}`  | The inviter's avatar URL             |
    | `{invite.code}`     | The invite code used                 |
    | `{invite.uses}`     | The invite's total use count         |
  </Accordion>

  <Accordion title="Leveling">
    Available in level-up message templates (`levelup set`).

    | Variable              | Output                                 |
    | --------------------- | -------------------------------------- |
    | `{level.new_rank}`    | Member's new level at time of level up |
    | `{level.next_rank}`   | Member's next level target             |
    | `{level.user_xp}`     | Member's current XP                    |
    | `{level.total_xp}`    | Member's total accumulated XP          |
    | `{level.rank}`        | Member's leaderboard rank              |
    | `{level.required_xp}` | XP required to reach the next level    |
  </Accordion>

  <Accordion title="Streaks">
    Available in `streaks message` templates, and usable anywhere embed scripting is supported (customcommand, invoke, etc.). Reads live from the member's current streak progress.

    | Variable                      | Output                                              |
    | ----------------------------- | --------------------------------------------------- |
    | `{streak.current}`            | Member's current streak length in days              |
    | `{streak.longest}`            | Member's longest streak ever reached                |
    | `{streak.daily}`              | Member's message count for today                    |
    | `{streak.threshold}`          | Daily messages required to keep the streak          |
    | `{streak.unlock_requirement}` | Total messages needed before streaks start counting |
    | `{streak.restores}`           | Member's available streak restore tokens            |
    | `{streak.unlocked}`           | `Yes`/`No` if the member has unlocked streaks       |

    Prefix with `target.` (e.g. `{target.streak.current}`) to reference another member instead of the message author, where supported.
  </Accordion>

  <Accordion title="Last.fm">
    Available in `lf embed set` templates only. All standard `{user.*}` and `{guild.*}` variables also apply.

    **Track**

    | Variable       | Output                         |
    | -------------- | ------------------------------ |
    | `{track}`      | Current track title            |
    | `{track.name}` | Current track title            |
    | `{track.url}`  | Track URL on Last.fm           |
    | `{plays}`      | Your play count for this track |

    **Artist**

    | Variable         | Output                          |
    | ---------------- | ------------------------------- |
    | `{artist}`       | Artist name                     |
    | `{artist.name}`  | Artist name                     |
    | `{artist.url}`   | Artist URL on Last.fm           |
    | `{artist.plays}` | Your play count for this artist |

    **Album**

    | Variable        | Output                |
    | --------------- | --------------------- |
    | `{album}`       | Album title           |
    | `{album.name}`  | Album title           |
    | `{album.url}`   | Album URL on Last.fm  |
    | `{album.cover}` | Album cover image URL |
    | `{cover}`       | Album cover image URL |

    **Account**

    | Variable     | Output                  |
    | ------------ | ----------------------- |
    | `{username}` | Linked Last.fm username |
  </Accordion>

  <Accordion title="Moderation">
    Available in moderation message templates (jail, DM punishments, invoke messages, etc.).

    | Variable              | Output                                        |
    | --------------------- | --------------------------------------------- |
    | `{reason}`            | The reason for the action                     |
    | `{target.mention}`    | Mentions the target                           |
    | `{target.id}`         | The target's ID                               |
    | `{target.name}`       | The target's username                         |
    | `{target.avatar}`     | The target's avatar URL                       |
    | `{target.created_at}` | The target's account creation date (relative) |
    | `{target.joined_at}`  | The target's guild join date (relative)       |
    | `{moderator.mention}` | Mentions the moderator                        |
    | `{moderator.name}`    | The moderator's username                      |
  </Accordion>

  <Accordion title="Affiliate">
    Available in affiliate message templates.

    | Variable                          | Output                                    |
    | --------------------------------- | ----------------------------------------- |
    | `{affiliate}`                     | Affiliate display name                    |
    | `{affiliate.mention}`             | Affiliate mention                         |
    | `{affiliate.name}`                | Affiliate username                        |
    | `{affiliate.id}`                  | Affiliate user ID                         |
    | `{affiliate.xp}`                  | Affiliate total XP                        |
    | `{affiliate.level}`               | Affiliate level                           |
    | `{affiliate.partnerships}`        | Affiliate partnership count               |
    | `{affiliate.rank}`                | Affiliate rank in the server              |
    | `{affiliated.server.name}`        | Invited server name                       |
    | `{affiliated.server.boost}`       | Invited server boost count                |
    | `{affiliated.server.membercount}` | Invited server member count               |
    | `{xp_gain}`                       | XP earned from the current affiliate post |
  </Accordion>

  <Accordion title="Boost">
    Available in boost message templates.

    | Variable            | Output                            |
    | ------------------- | --------------------------------- |
    | `{booster.mention}` | Mentions the booster              |
    | `{booster.name}`    | The booster's username            |
    | `{booster.id}`      | The booster's ID                  |
    | `{booster.nick}`    | The booster's server nickname     |
    | `{boost.count}`     | Total boost count                 |
    | `{boost.tier}`      | Current boost tier                |
    | `{boost.number}`    | Which boost this is               |
    | `{boost.required}`  | Boosts required for the next tier |
  </Accordion>

  <Accordion title="Transforms">
    Wrap any variable inside a transform function to modify its value. Works anywhere variables are supported.

    | Syntax                          | Output                                        |
    | ------------------------------- | --------------------------------------------- |
    | `{lower(variable)}`             | Converts the value to lowercase               |
    | `{upper(variable)}`             | Converts the value to uppercase               |
    | `{title(variable)}`             | Title-cases the value (each word capitalized) |
    | `{capitalize(variable)}`        | Capitalizes the first letter only             |
    | `{len(variable)}`               | Returns the character count of the value      |
    | `{strip(variable)}`             | Removes leading and trailing whitespace       |
    | `{replace(variable, old, new)}` | Replaces `old` with `new` in the value        |

    **Examples**

    ```
    {lower(track.name)}       → "blinding lights"
    {upper(artist.name)}      → "THE WEEKND"
    {title(album.name)}       → "After Hours"
    {len(user.name)}          → "8"
    {replace(guild.name, Bot, bот)}
    ```

    Transforms resolve the variable first, then apply the function — so `{lower(track.name)}` outputs the track title in lowercase, not the literal text `track.name`.
  </Accordion>
</AccordionGroup>
