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

# Variables Guide

> A full reference of the variables you can use when writing custom DM Notices.

When configuring custom DM Notices, you can use a select group of variables to inject dynamic data into the text. This allows you to format the message to your liking. For example, instead of typing a generic "You were promoted," you can use `{target.mention}` to automatically ping the target.

Below is the complete list of available variables, categorised by what they represent.

<h2 id="target">
  Target Variables
</h2>

These variables pull information about the user who is receiving the staff action (the person being hired, fired, promoted, or demoted).

| Variable               | Description                                   | Example Output                   |
| :--------------------- | :-------------------------------------------- | :------------------------------- |
| `{target.mention}`     | Mentions the target user directly.            | `<@1051468172693360670>`         |
| `{target.displayName}` | The target's display name.                    | `Joy ^•^`                        |
| `{target.username}`    | The target's Discord username.                | `snozlight`                      |
| `{target.id}`          | The target's unique Discord User ID.          | `1051468172693360670`            |
| `{target.avatar}`      | A direct URL to the target's profile picture. | `https://cdn.discordapp.com/...` |

<h2 id="executor">
  Executor Variables
</h2>

These variables pull information about the user who actually ran the `/staff` command.

| Variable                 | Description                                    | Example Output                   |
| :----------------------- | :--------------------------------------------- | :------------------------------- |
| `{executor.mention}`     | Mentions the manager.                          | `<@728846598330646662>`          |
| `{executor.displayName}` | The manager's display name.                    | `Frozen`                         |
| `{executor.username}`    | The manager's Discord username.                | `frozen4917`                     |
| `{executor.id}`          | The manager's unique Discord User ID.          | `728846598330646662`             |
| `{executor.avatar}`      | A direct URL to the manager's profile picture. | `https://cdn.discordapp.com/...` |

<h2 id="server">
  Server Variables
</h2>

Information regarding the Discord server where the action took place.

| Variable        | Description                               | Example Output                   |
| :-------------- | :---------------------------------------- | :------------------------------- |
| `{server.name}` | The exact name of your Discord server.    | `Nocturne Support`               |
| `{server.id}`   | Your server's unique Guild ID.            | `1470773005587190029`            |
| `{server.icon}` | A direct URL to your server's icon image. | `https://cdn.discordapp.com/...` |

<h2 id="context">
  Context & Action Variables
</h2>

These variables represent the specific details of the staff action being executed, such as the roles involved and the reasons provided.

| Variable         | Description                                                                                                      | Example Output                             |
| :--------------- | :--------------------------------------------------------------------------------------------------------------- | :----------------------------------------- |
| `{action}`       | The action executed (always past tense and lowercase).                                                           | `hired` / `fired` / `promoted` / `demoted` |
| `{tree.name}`    | The name of the hierarchy tree the action occurred in.                                                           | `Moderation`                               |
| `{role.name}`    | The name of the new base role acquired (or stripped away if fired).                                              | `Moderator`                                |
| `{oldRole.name}` | The name of the previous base role. *Note: Returns*`None`*for Hire, and is identical to*`{role.name}`*for Fire.* | `Trainee Mod`                              |
| `{reason}`       | The text provided in the `reason` field of the command.                                                          | `Breaking staff reporting policy!`         |
| `{notes}`        | The text provided in the optional `notes` field.                                                                 | `Remember to check the guidebook.`         |

<Warning>
  All variables are case-sensitive, i.e. `{target.ID}` and `{oldrole.name}` will not work, but `{target.id}` and `{oldRole.name}` will.
</Warning>

***

<h2 id="example">
  Real-World Example
</h2>

Not sure how to put this together? Here is an example of what a message might look like when it is configured and how it will be seen by the user.

<Tabs>
  <Tab title="Configured Example" icon="code-simple">
    <img src="https://mintcdn.com/nocturneidle/rKKUixGtrUsPbPeX/images/DMs-Notice-Modal.png?fit=max&auto=format&n=rKKUixGtrUsPbPeX&q=85&s=9974291e1c2864376e7ad2403e66f7e3" alt="DM Notice Configured Example" title="DM Notice Configured Example" className="mx-auto" style={{ width:"42%" }} width="525" height="638" data-path="images/DMs-Notice-Modal.png" />
  </Tab>

  <Tab title="Visual Output" icon="image">
    <Columns cols={2}>
      <Column>
        <img src="https://mintcdn.com/nocturneidle/HGP1XeHwOgeZO9_d/images/Staff-Hire.png?fit=max&auto=format&n=HGP1XeHwOgeZO9_d&q=85&s=89685da80a91982151c7b1d5ad232a37" alt="Staff Hire Command Output" title="Staff Hire Command Output" className="mx-auto" style={{ width:"91%" }} width="500" height="273" data-path="images/Staff-Hire.png" />
      </Column>

      <Column>
        <img src="https://mintcdn.com/nocturneidle/HGP1XeHwOgeZO9_d/images/Staff-Hire-DM-Message.png?fit=max&auto=format&n=HGP1XeHwOgeZO9_d&q=85&s=b102447f88f1a394977065bea4114ed2" alt="DM Message from Hire command" title="DM Message from Hire command" className="mx-auto" style={{ width:"98%" }} width="798" height="397" data-path="images/Staff-Hire-DM-Message.png" />
      </Column>
    </Columns>
  </Tab>
</Tabs>
