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

# Tickets

> Private support channels members open with a button, with forms, claiming, transcripts and ratings.

Members press a button, confine opens a private channel for them and your staff, and when it's closed you keep a transcript of the whole conversation on a web page.

You can set everything up on the [Dashboard](https://studio.confine.app) (**Tickets** in the sidebar) or with commands. Both change the same settings, so use whichever you like.

> [!NOTE]
>
> Setting up tickets needs the **Manage Server** permission. Confine needs **Manage Channels** and **Manage Roles** to make ticket channels and give people access to them.

## How it fits together

* **Ticket types** are the kinds of ticket you offer, like *Support*, *Billing* or *Report a member*. Each type has its own staff, category, form and messages. The dashboard calls them *kinds of ticket*.
* **Panels** are the messages members press to open a ticket. A panel shows one or more ticket types, as buttons or as a dropdown.

Most servers only need one type and one panel, which is exactly what setup makes.

## Getting started

### On the dashboard

Open **Tickets** on the [dashboard](https://studio.confine.app). A server with no tickets yet gets a short setup:

**1. Staff**

Pick the roles that answer tickets. They see every ticket and can claim and close them.

**2. Where tickets go**

Let confine make a hidden **Tickets** category and a **#ticket-logs** channel, or pick ones you already have.

**3. Form**

Optional. Questions members answer before their ticket opens, so staff know what it's about.

**4. Messages**

Pick the channel for the panel, and optionally write the panel message and the welcome message posted inside each ticket.

**5. Finishing touches**

Choose whether members can close their own tickets and whether they're asked for a rating.

Afterwards the page shows **Your ticket system**: a checklist of what's working, with anything that needs fixing marked.

### With a command

One command makes the category, the log channel, a *Support* ticket type and the panel.

```javascript Syntax theme={null}
,ticket setup (channel) (staff role)
```

```javascript Example theme={null}
,ticket setup #support @Support
```

Run `,ticket` on its own to see every ticket command, and `,ticket settings` to see how a ticket type is set up.

> [!TIP]
>
> Test it with an alt account or a friend. As an admin you can see every ticket and aren't held to the limits, so testing as yourself can be misleading.

## Ticket types

```javascript Syntax theme={null}
,ticket type add (name)
,ticket type remove (name)
,ticket type rename (name) to (new name)
```

```javascript Example theme={null}
,ticket type add Billing
```

A new type starts with the same category, log channel and staff as your first one. If you have exactly one panel, it's added to it straight away.

When you have more than one type, put its name first in the commands below: `,ticket staff Billing @Finance`. With only one type you can leave the name out.

### Staff, category and logs

* `,ticket staff (type) (role)`: adds a staff role, or takes it off if it's already there.
* `,ticket category (type) (category)`: where new ticket channels are made.
* `,ticket overflow (type) (category or off)`: a second category to use when the first is full (Discord fits 50 channels in a category).
* `,ticket logs (type) (channel or off)`: where opening, closing, ratings and transcript links are posted.

> [!NOTE]
>
> Staff role changes apply to tickets opened afterwards. To give a role access to a ticket that's already open, use `,ticket add @role` inside it.

### The button

```javascript Syntax theme={null}
,ticket button (type) (colour / emoji / label / description) (value)
```

```javascript Example theme={null}
,ticket button colour green
,ticket button emoji 🎫
,ticket button label Get help
```

Colours are blurple, green, gray and red. The label defaults to the type's name. The description only shows when the panel is a dropdown.

## Forms

A form is up to 5 questions members fill in, in a pop-up, before their ticket opens. Their answers are posted in the ticket.

```javascript Syntax theme={null}
,ticket form (type) add (short / long / choice) (question)
,ticket form (type) remove (number)
,ticket form (type) list
,ticket form (type) clear
```

```javascript Example theme={null}
,ticket form add What do you need help with?
,ticket form add long Explain the problem
,ticket form add choice Which game? | Fortnite | Minecraft
```

* **short** (the default) is a one-line answer, **long** is a paragraph, and **choice** is a list to pick from. List the choices after `|`.
* End a question with `optional` to make it optional.
* Questions are up to 45 characters (Discord's limit).

On the dashboard you can also add help text, an example answer, and the shortest and longest answer allowed.

## When a ticket opens

### Welcome message

Posted at the top of each new ticket and pinned. Leave it empty for the default. It works with the `{embed}` builder (see [Scripting](https://docs.confine.app/resources/scripting.md)) and [Variables](https://docs.confine.app/resources/variables.md), plus these:

* `{ticket.id}`: the ticket's number
* `{ticket.type}`: the ticket type's name
* `{ticket.channel}`: the ticket channel

```javascript Example theme={null}
,ticket welcome Thanks {user.mention}! Tell us what's up and we'll be right with you.
```

Use `,ticket welcome reset` to go back to the default. confine adds the **Claim ticket** and **Close ticket** buttons itself, so the welcome message can't have its own buttons.

### Pings

By default a new ticket pings the member who opened it and the staff roles.

* `,ticket ping (type) staff (on/off)`
* `,ticket ping (type) member (on/off)`
* `,ticket ping (type) (role)`: also ping another role, or stop pinging it

### Channel names

```javascript Syntax theme={null}
,ticket naming (type) (pattern)
```

```javascript Example theme={null}
,ticket naming ticket-{username}
```

`{id}`, `{id_padded}` (0042), `{username}`, `{nickname}` and `{type}` are filled in. The default is `ticket-{id}`.

### Limits

* `,ticket limit (type) (number)`: how many tickets of this type one member can have open at once (1 to 10, default 1).
* `,ticket totallimit (number)`: how many tickets one member can have open across every type (0 means no limit).
* `,ticket cooldown (type) (duration or off)`: how long a member waits between tickets, like `30s`, `10m`, `1h` or `1d`.

Staff aren't held to any of these.

## Inside a ticket

| Command | What it does |
| - | - |
| `,ticket close (reason)` | Closes the ticket. |
| `,ticket closerequest (hours) (reason)` | Asks the member if it can be closed. With hours, it closes by itself if they don't answer in time. Also `,ticket cr`. |
| `,ticket claim` | Says you're handling it. |
| `,ticket unclaim` | Lets it go again. |
| `,ticket transfer (member)` | Hands it to another staff member. |
| `,ticket add (member or role)` | Gives someone access to the ticket. |
| `,ticket remove (member or role)` | Takes their access away. |
| `,ticket rename (name)` | Renames the channel. |

The **Claim ticket** and **Close ticket** buttons on the welcome message do the same as the commands. Pressing **Close ticket** asks "Are you sure?" first, with the option to give a reason.

### Claiming

```javascript Syntax theme={null}
,ticket claiming (type) (open / readonly / private / off)
```

* **open**: other staff can still see and reply to a claimed ticket.
* **readonly**: other staff can read along, but only the claimer replies. This is the default.
* **private**: only the claimer (and admins) can see it.
* **off**: no Claim ticket button (`,ticket claim` still works).

## Closing

* `,ticket closing (type) delete`: the channel is deleted a few seconds after closing. This is the default.
* `,ticket closing (type) keep (category)`: the channel is locked instead, with **Reopen**, **Delete** and **Transcript** buttons, and optionally moved to a category. The member loses access; staff keep it.
* `,ticket userclose (type) (on/off)`: whether members can close their own tickets. Staff always can.
* `,ticket confirm (type) (on/off)`: whether Close ticket asks "Are you sure?" first.
* `,ticket dm (type) (on/off)`: DM the member when their ticket closes, with the reason and a link to the transcript.
* `,ticket rating (type) (on/off)`: ask the member to rate their support from 1 to 5 stars in that DM.

## Transcripts

When a ticket closes, confine saves the whole conversation (messages, embeds, images and files) on a web page. The link is posted in your log channel and sent to the member in their DM.

* Transcripts are kept for **one year**, then deleted.
* To open one, you sign in with Discord. Only the member who opened the ticket, that ticket type's staff and members with **Manage Server** can read it.
* Turn them off with `,ticket transcripts (type) off`.

> [!NOTE]
>
> Images and files in a transcript are Discord's own copies. If they're deleted from Discord, they may stop showing in the transcript.

## Panels

Setup posts your first panel. Use these to post more, or change one.

```javascript Syntax theme={null}
,ticket panel add (channel) (types)
,ticket panel remove (channel) (types)
,ticket panel style (channel) (buttons / dropdown)
,ticket panel message (channel) (message or reset)
,ticket panel resend (channel)
,ticket panel list
```

```javascript Example theme={null}
,ticket panel add #support Support Billing
,ticket panel style #support dropdown
```

* A panel shows up to 10 ticket types as buttons, or up to 25 as a dropdown.
* `panel remove` with no types takes the whole panel down.
* `panel resend` deletes the panel and posts it again at the bottom of the channel.
* The panel message works with the `{embed}` builder. The buttons come from the ticket types on it, so the message can't have its own.

## Blacklist

```javascript Syntax theme={null}
,ticket blacklist (member or role)
```

Stops a member, or everyone with a role, from opening tickets. Run it again to let them. On the dashboard it's under **Who can't open tickets**, where you can search for members by name.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.