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

# Variables

> Comprehensive list of context variables to use within the ticket system.

## Overview

Variables can be used in:

* Plain message content
* Inside embeds (`$v{...}` syntax)
* Inside conditional blocks (`{if ...}`)

Use `{variable.name}` syntax anywhere a message field is configurable.

***

## Variable Reference

<Tabs>
  <Tab title="Core">
    | Variable                                 | Output                                          |
    | ---------------------------------------- | ----------------------------------------------- |
    | `{ticket.case}`                          | The ticket's case number                        |
    | `{ticket.id}`                            | The ticket's channel ID                         |
    | `{ticket.open}`                          | Whether the ticket is open (`yes`/`no`)         |
    | `{ticket.deleted}`                       | Whether the ticket is deleted (`yes`/`no`)      |
    | `{ticket.type}`                          | The ticket's option label                       |
    | `{ticket.status}`                        | The ticket's current status                     |
    | `{ticket.opened_at}`                     | The ticket's opening time                       |
    | `{ticket.opened_at.raw}`                 | Opening time as a unix timestamp                |
    | `{ticket.opened_at.short}`               | Opening time as a short date                    |
    | `{ticket.claimed_at}`                    | The ticket's claim time                         |
    | `{ticket.claimed_at.raw}`                | Claim time as a unix timestamp                  |
    | `{ticket.claimed_at.short}`              | Claim time as a short date                      |
    | `{ticket.migrated_at}`                   | The ticket's migration time                     |
    | `{ticket.closed_at}`                     | The ticket's closure time                       |
    | `{ticket.closed_at.raw}`                 | Closure time as a unix timestamp                |
    | `{ticket.closed_at.short}`               | Closure time as a short date                    |
    | `{ticket.reopened_at}`                   | The ticket's reopen time                        |
    | `{ticket.deleted_at}`                    | The ticket's deletion time                      |
    | `{ticket.last_author_message_at}`        | Time the creator last sent a message            |
    | `{ticket.last_inactivity_notice_at}`     | Time the last inactivity notice was sent        |
    | `{ticket.auto_delete_after_close}`       | The auto-delete delay in seconds                |
    | `{ticket.auto_delete_after_close.human}` | The auto-delete delay formatted                 |
    | `{ticket.auto_delete_at}`                | The scheduled auto-delete time                  |
    | `{ticket.closed_automatically}`          | Whether the ticket was auto-closed (`yes`/`no`) |
  </Tab>

  <Tab title="Reasons">
    | Variable                   | Output                                          |
    | -------------------------- | ----------------------------------------------- |
    | `{ticket.reason}`          | The most recent close reason (fallback for all) |
    | `{ticket.reason.claimed}`  | The reason the ticket was claimed               |
    | `{ticket.reason.migrated}` | The reason the ticket was moved                 |
    | `{ticket.reason.closed}`   | The reason the ticket was closed                |
    | `{ticket.reason.reopened}` | The reason the ticket was reopened              |
    | `{ticket.reason.deleted}`  | The reason the ticket was deleted               |
  </Tab>

  <Tab title="Users">
    The following prefixes each expose the same set of user fields:

    * `ticket.author` / `ticket.creator` — the ticket creator
    * `ticket.claimer` — the staff member who claimed it
    * `ticket.closer` — the staff member who closed it
    * `ticket.reopener` — who reopened it
    * `ticket.deleter` — who deleted it

    **Available suffixes for each prefix:**

    | Suffix            | Output                                    |
    | ----------------- | ----------------------------------------- |
    | `.id`             | User ID                                   |
    | `.name`           | Username                                  |
    | `.display_name`   | Display name                              |
    | `.tag`            | Full tag (e.g. `user#0000`)               |
    | `.full`           | Same as tag                               |
    | `.mention`        | User mention                              |
    | `.bot`            | Whether the user is a bot (`yes`/`no`)    |
    | `.display_avatar` | Display avatar URL                        |
    | `.avatar`         | Avatar URL                                |
    | `.created_at`     | Account creation timestamp                |
    | `.joined_at`      | Server join timestamp                     |
    | `.color`          | Top role color                            |
    | `.role_list`      | All role mentions                         |
    | `.role_text_list` | All role names as text                    |
    | `.top_role`       | Top role mention                          |
    | `.role_count`     | Number of roles                           |
    | `.boost`          | Whether the user is boosting (`yes`/`no`) |
    | `.boost_since`    | Boost start timestamp                     |
  </Tab>

  <Tab title="Channel">
    | Variable                   | Output                 |
    | -------------------------- | ---------------------- |
    | `{ticket.channel.id}`      | Ticket channel ID      |
    | `{ticket.channel.name}`    | Ticket channel name    |
    | `{ticket.channel.mention}` | Ticket channel mention |
  </Tab>

  <Tab title="Panel / Controller">
    Both `ticket.panel.*` and `ticket.controller.*` refer to the same panel data.

    | Variable                                | Output                            |
    | --------------------------------------- | --------------------------------- |
    | `{ticket.panel.name}`                   | Panel name                        |
    | `{ticket.panel.mode}`                   | Panel mode (`buttons`/`dropdown`) |
    | `{ticket.panel.message.id}`             | Panel message ID                  |
    | `{ticket.panel.maximum}`                | Max open tickets from this panel  |
    | `{ticket.panel.dropdown_placeholder}`   | Dropdown placeholder text         |
    | `{ticket.panel.channel.id}`             | Panel channel ID                  |
    | `{ticket.panel.channel.name}`           | Panel channel name                |
    | `{ticket.panel.channel.mention}`        | Panel channel mention             |
    | `{ticket.panel.category.default.id}`    | Default category ID               |
    | `{ticket.panel.category.default.name}`  | Default category name             |
    | `{ticket.panel.category.overflow.id}`   | Overflow category ID              |
    | `{ticket.panel.category.overflow.name}` | Overflow category name            |
  </Tab>

  <Tab title="Option">
    | Variable                                        | Output                            |
    | ----------------------------------------------- | --------------------------------- |
    | `{ticket.option.label}`                         | Option label                      |
    | `{ticket.option.emoji}`                         | Option emoji                      |
    | `{ticket.option.description}`                   | Option description                |
    | `{ticket.option.style}`                         | Option button style               |
    | `{ticket.option.disabled}`                      | Whether the option is disabled    |
    | `{ticket.option.auto_close_after}`              | Auto-close delay in seconds       |
    | `{ticket.option.auto_close_after.human}`        | Auto-close delay formatted        |
    | `{ticket.option.auto_delete_after_close}`       | Auto-delete delay in seconds      |
    | `{ticket.option.auto_delete_after_close.human}` | Auto-delete delay formatted       |
    | `{ticket.option.inactivity_time}`               | Inactivity timer in seconds       |
    | `{ticket.option.inactivity_time.human}`         | Inactivity timer formatted        |
    | `{ticket.option.category.id}`                   | Option category ID                |
    | `{ticket.option.category.name}`                 | Option category name              |
    | `{ticket.option.required_roles}`                | Count of required roles           |
    | `{ticket.option.required_roles.names}`          | Required role names               |
    | `{ticket.option.required_roles.mentions}`       | Required role mentions            |
    | `{ticket.option.required_roles.mode}`           | Required roles mode (`Any`/`All`) |
  </Tab>

  <Tab title="Forms">
    | Variable                         | Output                              |
    | -------------------------------- | ----------------------------------- |
    | `{ticket.form.id}`               | Form ID                             |
    | `{ticket.form.name}`             | Form internal name                  |
    | `{ticket.form.title}`            | Form modal title                    |
    | `{ticket.form.submitted_at}`     | When the form was submitted         |
    | `{ticket.form.submitted_at.raw}` | Submission time as unix timestamp   |
    | `{ticket.form.field.<key>}`      | The display value of a field answer |
    | `{ticket.form.field.<key>.raw}`  | The raw value of a field answer     |
  </Tab>

  <Tab title="Transcript">
    | Variable                               | Output                          |
    | -------------------------------------- | ------------------------------- |
    | `{ticket.transcript.url}`              | Transcript URL                  |
    | `{ticket.transcript.created_at}`       | When the transcript was created |
    | `{ticket.transcript.created_at.raw}`   | Creation time as unix timestamp |
    | `{ticket.transcript.created_at.short}` | Creation time as short date     |
    | `{ticket.transcript.expires_at}`       | When the transcript expires     |
    | `{ticket.transcript.expires_at.raw}`   | Expiry time as unix timestamp   |
    | `{ticket.transcript.expires_at.short}` | Expiry time as short date       |
  </Tab>
</Tabs>

***

## Guild & Date Variables

| Variable               | Output                          |
| ---------------------- | ------------------------------- |
| `{guild.name}`         | Server name                     |
| `{guild.id}`           | Server ID                       |
| `{guild.count}`        | Server member count             |
| `{guild.icon}`         | Server icon URL                 |
| `{guild.banner}`       | Server banner URL               |
| `{date.now}`           | Current date (`YYYY-MM-DD`)     |
| `{date.now_proper}`    | Current date (`Month DD, YYYY`) |
| `{date.utc_timestamp}` | Current unix timestamp          |
| `{time.now}`           | Current time (`HH:MM AM/PM`)    |

***

## Quick Tips

* Timestamps come in three forms: normal Discord timestamp `{ticket.opened_at}`, unix `{ticket.opened_at.raw}`, and short date `{ticket.opened_at.short}`.
* Use `{ticket.form.field.<key>}` for the display value users submitted.
* Use `{ticket.form.field.<key>.raw}` when you need the raw stored value or selected ID.
* `ticket.creator.*` is an alias for `ticket.author.*`.
* Use `{ticket.closed_automatically}` when you want auto-close-specific wording.
* Use `{ticket.option.required_roles.mentions}` in the Required Roles message to show exactly what the member is missing.
* To make a field appear only sometimes, wrap it in `{if ...}{/if}`.
