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

# Variables

> A comprehensive guide on variables and how to use them in custom messages.

Variables allow you to dynamically insert user, server, channel, and time information into your bot's custom messages. Whenever ZEON sends a customized message, it parses these variables into real, live data.

<Note>
  Not all variables work in every context! For example, `{rolecolor}` won't work in a message if there is no specific role involved in the trigger.
</Note>

## Complete Variable Reference

Below is a complete list of every single variable supported by the bot's parser.

<Warning>
  **Advanced Tip**: Variables like `{target}` and `{author}` are context-dependent. `{author}` is usually the person triggering the command, while `{target}` is the person being acted upon.
</Warning>

<AccordionGroup>
  <Accordion title="Server Variables" icon="server">
    | Variable                       | Description                         |
    | :----------------------------- | :---------------------------------- |
    | `{servericon}`                 | Server icon URL                     |
    | `{serverbanner}`               | Server banner URL                   |
    | `{serversplash}`               | Server splash URL                   |
    | `{serverdiscoverysplash}`      | Server discovery splash URL         |
    | `{servermembercount}`          | Total server member count           |
    | `{servervanity}`               | The server's vanity URL             |
    | `{servername}`                 | Name of the server                  |
    | `{serverid}`                   | ID of the server                    |
    | `{boostcount}`                 | Total number of boosts              |
    | `{boostercount}`               | Total number of boosters            |
    | `{boostlevel}`                 | Current boost tier                  |
    | `{serverowner}`                | Mentions the server owner           |
    | `{serverownerid}`              | Server owner's ID                   |
    | `{serverdescription}`          | The server's description            |
    | `{serverchannelcount}`         | Total channel count                 |
    | `{servertextchannelcount}`     | Total text channel count            |
    | `{servervoicechannelcount}`    | Total voice channel count           |
    | `{servercategorycount}`        | Total category count                |
    | `{serverrolecount}`            | Total role count                    |
    | `{serveremojicount}`           | Total emoji count                   |
    | `{serverstickercount}`         | Total sticker count                 |
    | `{servercreatedat}`            | Timestamp of server creation        |
    | `{serververificationlevel}`    | Server verification level           |
    | `{servernsfw}`                 | Server NSFW level                   |
    | `{servermaxmembers}`           | Maximum members allowed             |
    | `{servermaxpresences}`         | Maximum presences allowed           |
    | `{servermaxvideochannels}`     | Maximum video channel users         |
    | `{serverpreferredlocale}`      | Preferred locale of the server      |
    | `{servermfaenabled}`           | MFA enabled status                  |
    | `{serverexplicit}`             | Explicit content filter level       |
    | `{serverfeatures}`             | List of server features             |
    | `{serverafkchannel}`           | Mentions the AFK channel            |
    | `{serverafktimeout}`           | AFK timeout duration                |
    | `{serversystemchannel}`        | Mentions the system channel         |
    | `{serverruleschannel}`         | Mentions the rules channel          |
    | `{serverpublicupdateschannel}` | Mentions the public updates channel |
  </Accordion>

  <Accordion title="User Variables" icon="user">
    | Variable              | Description                              |
    | :-------------------- | :--------------------------------------- |
    | `{user}`              | Mentions the user                        |
    | `{username}`          | The user's name                          |
    | `{userid}`            | The user's ID                            |
    | `{usernick}`          | The user's nickname                      |
    | `{userdisplayname}`   | The user's display name                  |
    | `{usericon}`          | User's display avatar URL                |
    | `{useravatar}`        | User's global avatar URL                 |
    | `{userglobalavatar}`  | User's default avatar URL                |
    | `{userjoinedat}`      | Timestamp of when they joined the server |
    | `{usercreatedat}`     | Timestamp of account creation            |
    | `{userbot}`           | Whether the user is a bot                |
    | `{usertoprole}`       | Mentions the user's highest role         |
    | `{usertoproleid}`     | ID of user's highest role                |
    | `{userrolecount}`     | Number of roles the user has             |
    | `{usercolor}`         | The user's role color                    |
    | `{userhexcolor}`      | The user's hex color                     |
    | `{userstatus}`        | User's current status                    |
    | `{userpremium}`       | Whether user is boosting                 |
    | `{userpremiumsince}`  | Timestamp of boost start                 |
    | `{userdiscriminator}` | User's discriminator                     |
    | `{userglobalname}`    | User's global name                       |
    | `{usertimedout}`      | Whether the user is timed out            |
    | `{usertimeoutat}`     | Timestamp of timeout expiry              |
  </Accordion>

  <Accordion title="Author Variables" icon="pen-nib">
    | Variable              | Description                              |
    | :-------------------- | :--------------------------------------- |
    | `{author}`            | Mentions the author                      |
    | `{authorname}`        | The author's name                        |
    | `{authorid}`          | The author's ID                          |
    | `{authornick}`        | The author's nickname                    |
    | `{authordisplayname}` | The author's display name                |
    | `{authoricon}`        | Author's display avatar URL              |
    | `{authoravatar}`      | Author's global avatar URL               |
    | `{authorjoinedat}`    | Timestamp of when they joined the server |
    | `{authorcreatedat}`   | Timestamp of account creation            |
    | `{authorbot}`         | Whether the author is a bot              |
    | `{authortoprole}`     | Mentions the author's highest role       |
    | `{authorrolecount}`   | Number of roles the author has           |
    | `{authorcolor}`       | The author's role color                  |
    | `{authorstatus}`      | Author's current status                  |
  </Accordion>

  <Accordion title="Target Variables" icon="crosshairs">
    | Variable              | Description                              |
    | :-------------------- | :--------------------------------------- |
    | `{target}`            | Mentions the target                      |
    | `{targetname}`        | The target's name                        |
    | `{targetid}`          | The target's ID                          |
    | `{targetnick}`        | The target's nickname                    |
    | `{targetdisplayname}` | The target's display name                |
    | `{targeticon}`        | Target's display avatar URL              |
    | `{targetavatar}`      | Target's global avatar URL               |
    | `{targetjoinedat}`    | Timestamp of when they joined the server |
    | `{targetcreatedat}`   | Timestamp of account creation            |
    | `{targetbot}`         | Whether the target is a bot              |
    | `{targettoprole}`     | Mentions the target's highest role       |
    | `{targetrolecount}`   | Number of roles the target has           |
    | `{targetcolor}`       | The target's role color                  |
    | `{targetstatus}`      | Target's current status                  |
  </Accordion>

  <Accordion title="Channel & Thread Variables" icon="hashtag">
    | Variable                         | Description                           |
    | :------------------------------- | :------------------------------------ |
    | `{channelid}`                    | ID of the channel                     |
    | `{channelname}`                  | Name of the channel                   |
    | `{channel}`                      | Mentions the channel                  |
    | `{channelcreatedat}`             | Timestamp of channel creation         |
    | `{channeltype}`                  | Type of the channel                   |
    | `{channeltopic}`                 | The topic of the channel              |
    | `{channelcategory}`              | The category the channel is in        |
    | `{channelcategoryid}`            | ID of the channel's category          |
    | `{channelnsfw}`                  | Whether the channel is NSFW           |
    | `{channelposition}`              | The position of the channel           |
    | `{channelslowmode}`              | The slowmode delay of the channel     |
    | `{channeldefaultthreadslowmode}` | Default thread slowmode delay         |
    | `{channelnews}`                  | Whether the channel is a news channel |
    | `{channeluserlimit}`             | User limit for voice channels         |
    | `{channelbitrate}`               | Bitrate for voice channels            |
    | `{channelrtcregion}`             | RTC region for voice channels         |
    | `{channelusers}`                 | Number of users in the voice channel  |
    | `{threadarchived}`               | Whether the thread is archived        |
    | `{threadlocked}`                 | Whether the thread is locked          |
    | `{threadmembercount}`            | Thread member count                   |
    | `{threadmessagecount}`           | Thread message count                  |
    | `{threadautohideduration}`       | Auto archive duration                 |
    | `{threadowner}`                  | Mentions the thread owner             |
    | `{forumdefaultlayout}`           | Forum default layout                  |
    | `{forumdefaultsortorder}`        | Forum default sort order              |
    | `{forumdefaultreaction}`         | Forum default reaction                |
  </Accordion>

  <Accordion title="Message Variables" icon="message">
    | Variable               | Description                            |
    | :--------------------- | :------------------------------------- |
    | `{messageid}`          | ID of the message                      |
    | `{messagecontent}`     | The text content of the message        |
    | `{messageauthor}`      | Mentions the message author            |
    | `{messageauthorid}`    | Message author's ID                    |
    | `{messagecreatedat}`   | Timestamp of message creation          |
    | `{messageeditedat}`    | Timestamp of message edit              |
    | `{messageattachments}` | Number of attachments                  |
    | `{messageembeds}`      | Number of embeds                       |
    | `{messagereactions}`   | Number of reactions                    |
    | `{messagepinned}`      | Whether the message is pinned          |
    | `{messagejump}`        | A clickable URL to jump to the message |
    | `{messagetype}`        | Type of the message                    |
  </Accordion>

  <Accordion title="Role Variables" icon="shield">
    | Variable            | Description                          |
    | :------------------ | :----------------------------------- |
    | `{roleid}`          | ID of the role                       |
    | `{rolename}`        | Name of the role                     |
    | `{rolemention}`     | Mentions the role                    |
    | `{rolecolor}`       | The color of the role                |
    | `{rolehoist}`       | Whether the role is hoisted          |
    | `{rolementionable}` | Whether the role is mentionable      |
    | `{roleposition}`    | The position of the role             |
    | `{rolemembercount}` | Number of members who have this role |
    | `{rolecreatedat}`   | Timestamp of role creation           |
    | `{rolemanaged}`     | Whether the role is managed          |
    | `{rolepermissions}` | The permissions value of the role    |
  </Accordion>

  <Accordion title="Emoji Variables" icon="face-smile">
    | Variable           | Description                   |
    | :----------------- | :---------------------------- |
    | `{emojiid}`        | ID of the emoji               |
    | `{emojiname}`      | Name of the emoji             |
    | `{emojimention}`   | Renders the emoji             |
    | `{emojiurl}`       | URL of the emoji image        |
    | `{emojianimated}`  | Whether the emoji is animated |
    | `{emojimanaged}`   | Whether the emoji is managed  |
    | `{emojicreatedat}` | Timestamp of emoji creation   |
  </Accordion>

  <Accordion title="Invite Variables" icon="link">
    | Variable            | Description                                    |
    | :------------------ | :--------------------------------------------- |
    | `{invitecode}`      | The invite code string                         |
    | `{inviteurl}`       | The full invite URL                            |
    | `{invitechannel}`   | Mentions the invite's channel                  |
    | `{inviteuses}`      | How many times the invite has been used        |
    | `{invitemaxuses}`   | Max uses allowed for the invite                |
    | `{invitemaxage}`    | Max age allowed for the invite                 |
    | `{invitetemporary}` | Whether the invite grants temporary membership |
    | `{invitecreatedat}` | Timestamp of invite creation                   |
    | `{inviteexpiresat}` | Timestamp of invite expiration                 |
    | `{inviter}`         | Mentions the user who created the invite       |
  </Accordion>

  <Accordion title="Time, Date & Misc Variables" icon="clock">
    | Variable        | Description                             |
    | :-------------- | :-------------------------------------- |
    | `{timestamp}`   | Relative time (e.g. "2 hours ago")      |
    | `{time}`        | Full date and time                      |
    | `{unix}`        | Current UNIX timestamp                  |
    | `{date}`        | Current Date                            |
    | `{shorttime}`   | Short time format                       |
    | `{longtime}`    | Long time format                        |
    | `{shortdate}`   | Short date format                       |
    | `{year}`        | The current year                        |
    | `{month}`       | The current month                       |
    | `{day}`         | The current day                         |
    | `{hour}`        | The current hour                        |
    | `{minute}`      | The current minute                      |
    | `{second}`      | The current second                      |
    | `{random}`      | A random number between 1 and 100       |
    | `{randuser}`    | Mentions a random user in the server    |
    | `{randchannel}` | Mentions a random channel in the server |
  </Accordion>
</AccordionGroup>

***

## How to Use Variables

Variables must be wrapped in curly braces `{}`. For example, if you want to mention a user, you would simply type `{user}` in your message setup.

When a module triggers a custom message, ZEON dynamically replaces the text with the actual data. Here is how you can practically use variables in different modules.

### Vanity Roles

In the **Vanity Roles** module, when a user updates their status to include your server's vanity URL, the bot can send a customized reward message. The variables evaluate in the context of the user receiving the role.

<CodeGroup>
  ```bash Input Message theme={null}
  .vanityrole message Thank you {user} for repping {servername} in your status! You now have {userrolecount} roles.
  ```

  ```text Output Result theme={null}
  Thank you @john_doe for repping ZEON Official in your status! You now have 4 roles.
  ```
</CodeGroup>

### Boost Greet

When a member boosts your server, you can use variables to show appreciation dynamically in a welcome channel.

<CodeGroup>
  ```bash Input Message theme={null}
  .boostgreet message We just got boosted by {user}! We now have {boostcount} boosts and are at tier {boostlevel}!
  ```

  ```text Output Result theme={null}
  We just got boosted by @jane_doe! We now have 15 boosts and are at tier 3!
  ```
</CodeGroup>
