> ## 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.

# Commands & Permissions

> All the commands and permissions related to managing and using the Tickets system.

## Role Priority

When an option uses a mix of support roles, trainee roles, and global staff roles, the system resolves them in this order:

**Support → Trainee → Staff**

That means:

* If someone has both a support role and a trainee role for a ticket option, they are treated as **Support**.
* If someone has a trainee role for a ticket option and also has a generic global staff role, they are treated as **Trainee**.
* Generic **Staff** roles do not override option-specific trainee behavior.

***

## Commands

The primary command for the system is `.tickets`. It also supports aliases `.ticket` and `.tix`.

<Warning>
  All commands listed require the `administrator` permission or a fake permission override.
</Warning>

***

## Configuration Commands

These commands let you configure the structure of the tickets system.

<AccordionGroup>
  <Accordion title="System Management">
    | Command                                     | Description                                                 |
    | ------------------------------------------- | ----------------------------------------------------------- |
    | `.tickets panels`                           | Open the panel manager to add, configure, or remove panels  |
    | `.tickets options`                          | Open the option manager to configure ticket types per panel |
    | `.tickets forms`                            | Open the form manager to create and manage intake forms     |
    | `.tickets resend [channel]`                 | Repost the panel message to its configured channel          |
    | `.tickets set`                              | View and manage server-wide settings                        |
    | `.tickets set transcriptchannel [#channel]` | Set or clear the global transcript channel                  |
    | `.tickets set logchannel [#channel]`        | Set or clear the global log channel                         |
  </Accordion>

  <Accordion title="Stats & Listings">
    | Command                          | Description                                                                                       |
    | -------------------------------- | ------------------------------------------------------------------------------------------------- |
    | `.tickets list`                  | List all currently open tickets in the server                                                     |
    | `.tickets stats [period] [user]` | Show server-wide or per-user ticket stats. Period accepts values like `30m`, `2h`, `1d`, or `all` |
    | `.tickets profile [user]`        | View a user's ticket profile — total tickets, open tickets, blacklist status                      |
    | `.tickets profiles`              | Manage server-wide claim profiles                                                                 |
    | `.tickets profiles [user]`       | View and edit a specific member's claim profile                                                   |
    | `.tickets cleanup`               | Remove deleted ticket records from the database                                                   |
  </Accordion>

  <Accordion title="Staff Role Management">
    | Command                                 | Description                                                                       |
    | --------------------------------------- | --------------------------------------------------------------------------------- |
    | `.tickets support`                      | List all global support roles                                                     |
    | `.tickets support grant <role>`         | Add a role as a global support role                                               |
    | `.tickets support revoke <role>`        | Remove a role from global support roles                                           |
    | `.tickets staff`                        | List all global staff and trainee roles                                           |
    | `.tickets staff grant <role>`           | Add a role as a global staff role                                                 |
    | `.tickets staff revoke <role>`          | Remove a role from global staff roles                                             |
    | `.tickets trainee`                      | List global trainee roles (or ticket-level overrides if used inside a ticket)     |
    | `.tickets trainee grant <member/role>`  | Add a global trainee role, or grant trainee permissions inside the current ticket |
    | `.tickets trainee revoke <member/role>` | Remove a global trainee role, or revoke ticket-level trainee permissions          |
  </Accordion>
</AccordionGroup>

***

## Ticket Interaction Commands

These commands are used inside ticket channels to manage individual tickets.

<AccordionGroup>
  <Accordion title="Claiming">
    | Command                   | Description                                                                   |
    | ------------------------- | ----------------------------------------------------------------------------- |
    | `.tickets claim [reason]` | Claim the current ticket. Restricts visibility to claimer + author by default |
    | `.tickets unclaim`        | Release the claim on the current ticket, restoring normal visibility          |
  </Accordion>

  <Accordion title="Closing">
    | Command                    | Description                                   |
    | -------------------------- | --------------------------------------------- |
    | `.tickets close [reason]`  | Close the current ticket                      |
    | `.tickets reopen [reason]` | Reopen a closed ticket                        |
    | `.tickets delete [reason]` | Permanently delete the current ticket channel |
  </Accordion>

  <Accordion title="Ticket Modifications">
    | Command                          | Description                                             |
    | -------------------------------- | ------------------------------------------------------- |
    | `.tickets rename <name>`         | Rename the current ticket channel                       |
    | `.tickets move <panel> [reason]` | Move the current ticket to a different panel's category |
  </Accordion>

  <Accordion title="Reason Editing">
    | Command                             | Description                                                                                                   |
    | ----------------------------------- | ------------------------------------------------------------------------------------------------------------- |
    | `.tickets reason <action> <reason>` | Edit the stored reason for a lifecycle action. Valid actions: `claim`, `close`, `reopen`, `delete`, `migrate` |
  </Accordion>

  <Accordion title="Access Management">
    | Command                            | Description                                                                                     |
    | ---------------------------------- | ----------------------------------------------------------------------------------------------- |
    | `.tickets allow <member/role>`     | Manually grant a member or role access to the current ticket                                    |
    | `.tickets allow list`              | List all manually allowed members and roles in the current ticket                               |
    | `.tickets deny <member/role>`      | Remove a member or role's access from the current ticket                                        |
    | `.tickets blacklist [member/role]` | Toggle a member or role on the global ticket blacklist. Blacklisted members cannot open tickets |
  </Accordion>

  <Accordion title="Transcripts">
    | Command                         | Description                                         |
    | ------------------------------- | --------------------------------------------------- |
    | `.tickets transcript`           | Generate a transcript of the current ticket         |
    | `.tickets transcript <channel>` | Generate a transcript for a specific ticket channel |
    | `.tickets transcript <case_id>` | Retrieve a saved transcript by case ID              |
  </Accordion>
</AccordionGroup>
