# Tickets

Source: https://righteousbot.dev/docs/features/tickets/

Post a ticket panel with several ticket types, each with its own greeting, category, naming and limits.

One panel carries several buttons (or a dropdown). Each opens a different *type* of ticket, called a preset, with its own greeting, category, channel naming, limit and up to five opening questions. A preset overrides the server's ticket defaults, and anything it leaves unset falls back to them.

## Post the panel [#post-the-panel]

[`,ticket setup`](/commands/server-tools/ticket/#ticket-setup) posts the panel in the current channel: one button per enabled preset in your order, or one dropdown in dropdown mode. With no presets you still get a plain **Open** button that uses the server defaults.

<CommandBlock syntax=",ticket setup [embed]" example=",ticket setup {description: Need help? Click below.}" />

## Create a preset [#create-a-preset]

[`,ticket preset`](/commands/server-tools/ticket/#ticket-preset) manages them: `new`, `set`, `show`, `list`, `delete`, `enable`, `disable`. `,ticket panel` opens the same settings as a clickable manager.

<CommandBlock syntax=",ticket preset new <label>" example=",ticket preset new Support" />

<CommandBlock syntax=",ticket preset set <type> <field> [value]" example=",ticket preset set support category #tickets" />

A blank value clears a **value, channel or role** field back to *inherit*. Toggles need `on` or `off`, three-state toggles need the word `inherit`, and `style` and `label` can't be blank. A preset's own **blacklist** is panel-only.

<Callout type="tip">
  A preset that "isn't working" is often fine: the server default behind it was never set either.
</Callout>

## Reopen a ticket [#reopen-a-ticket]

Every ticket has a **serial** (one running count for the whole server, the true identity, `{ticket.serial}`) and a **display number** (counted per type, the one in the channel name, `{ticket.id}`). `support-1` and `billing-1` can both exist.

[`,ticket reopen`](/commands/server-tools/ticket/#ticket-reopen) does two different things:

| You run                             | For                    | Result                                                                                                   |
| ----------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
| `,ticket reopen` inside the channel | An **archived** ticket | Moves back to the open category, opener's access restored. Nothing lost                                  |
| `,ticket reopen <type> <number>`    | A **deleted** ticket   | Rebuilt under the same number with **no message history**. The log channel transcript is the only record |

<CommandBlock syntax=",ticket reopen [type] [number]" example=",ticket reopen support 3" />

A number for an archived ticket is refused with "reopen it from inside its own channel". If several types have a deleted ticket with that number, the bot asks which; naming the type skips the question. The 🔓 button does the in-channel reopen if the control row is on.

## Write the greeting and the panel [#write-the-greeting-and-the-panel]

Two separate embed codes, rendered in different places. Both need **Manage Server** and no premium.

| Code            | Set with                                                                                                                         | Renders                                             |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **Panel embed** | [`,ticket setup`](/commands/server-tools/ticket/#ticket-setup)                                                                   | Once, on the panel message carrying the Open button |
| **Greeting**    | [`,ticket message`](/commands/server-tools/ticket/#ticket-message), or per type with `,ticket preset set <type> greeting <code>` | Inside every new ticket                             |

Editing one never changes the other.

<CommandBlock syntax=",ticket message <code>" example=",ticket message {color: #fb4868}$p{title: {ticket.type} - ticket #{ticket.id}}$p{description: {ticket.opener} thanks for getting in touch, staff have been notified and will answer in this channel.}$p{field: Opened && {ticket.created} && inline}$p{footer: {guild.name}}" />

<EmbedPreview code="{color: #fb4868}$p{title: {ticket.type} - ticket #{ticket.id}}$p{description: {ticket.opener} thanks for getting in touch, staff have been notified and will answer in this channel.}$p{field: Opened && {ticket.created} && inline}$p{footer: {guild.name}}" caption="The greeting as it posts inside a new ticket, with sample values." />

<CommandBlock syntax=",ticket setup [embed]" example=",ticket setup {color: #fb4868}$p{title: Need a hand?}$p{description: Open a ticket below and the {guild.name} staff team will pick it up. Please don't DM or ping staff directly.}$p{thumbnail: {guild.icon}}" />

<EmbedPreview code="&#x22;{color: #fb4868}$p{title: Need a hand?}$p{description: Open a ticket below and the {guild.name} staff team will pick it up. Please don't DM or ping staff directly.}$p{thumbnail: {guild.icon}}&#x22;" caption="The panel embed; Righteous adds the Open button under it." />

* **`{ticket.*}` works only in the greeting.** Elsewhere, including the panel, `,customembed` and the close and archive logs, it posts its own name (`ticket.id`). General tokens like `{user}` and `{guild.name}` work in both.
* **`{ticket.answer1}` to `{ticket.answer5}`** insert the opening answers. A token with no value yet (`{ticket.claimer}` before a claim) is blank, but an *unresolved* one shows its own name.
* **The greeting honors `++delete <seconds>`. The panel ignores it**, since it would delete its own button.
* **A colored button in the greeting or the panel can carry a [private reply](/docs/features/embed-codes/#answer-a-button-with-a-private-reply).** It is filled in for whoever presses it, and `{ticket.*}` doesn't work inside it.

<CommandBlock syntax=",ticket setup [embed]" example=",ticket setup {title: Need a hand?}$p{button: blue && Before you open one && reply: {description: Search the channel first; your answer may already be there.}}" />

<EmbedPreview surface="message" code="{title: Need a hand?}$p{button: blue && Before you open one && reply: {description: Search the channel first; your answer may already be there.}}" caption="A panel with an extra button. Press it and only the person who pressed sees the reply; Righteous still adds the Open button." />

* **The panel is rendered once**, so `{guild.membercount}` stays as of the day you posted it.

A preset's **channel-name template** (`,ticket preset set <type> channelname`) is not an embed, so it has its own tokens (`{ticket.num}`, `{ticket.id}`, `{ticket.type}`, `{ticket.opener}` as a username, `{num}`, `{preset}`, `{user}` and some server ones) and comes out lowercased with hyphens. `{ticket.num}` works only there. The code language is in [embed codes](/docs/features/embed-codes/).

## Archive idle tickets [#archive-idle-tickets]

[`,ticket autoclose`](/commands/server-tools/ticket/#ticket-autoclose) sets the server-wide idle window. A silent ticket gets a warning, then is **archived** 24 hours later, never deleted. A preset can override it, and `0` turns it off for that type.

<CommandBlock syntax=",ticket autoclose <hours|off>" example=",ticket autoclose 72" />

## Block people from opening tickets [#block-people-from-opening-tickets]

[`,ticket blacklist`](/commands/server-tools/ticket/#ticket-blacklist) stops a user or role from **opening** tickets in this server. It doesn't remove anyone from a ticket they already have.

<CommandBlock syntax=",ticket blacklist <add|remove|list> [@role/@user]" example=",ticket blacklist add @spammer" />

There are two blacklists, and the refusal tells you which:

| List                               | Run by             | Refusal                                               | Scope                                                      |
| ---------------------------------- | ------------------ | ----------------------------------------------------- | ---------------------------------------------------------- |
| **Ticket blacklist** (this one)    | **Manage Server**  | "You are not allowed to open tickets in this server." | This server. A per-type block is set from the ticket panel |
| **Global blacklist**, `,blacklist` | **Bot owner only** | "You cannot use this bot."                            | The bot everywhere, including the Open button              |

The blocked member is never told which entry matched. Only staff logs name it. On prefix commands the global list says nothing at all; slash commands and buttons always answer.

## Turn on the in-ticket control row [#turn-on-the-in-ticket-control-row]

[`,ticket buttons`](/commands/server-tools/ticket/#ticket-buttons) adds two rows of staff buttons to every new ticket: Add User, Remove User, Rename, Reason, Transfer, Claim, Log, Close, Delete, and Archive once the server has an archive category. &#x2A;*Off by default.**

<CommandBlock syntax=",ticket buttons <on|off>" example=",ticket buttons on" />

## Keep transcripts [#keep-transcripts]

[`,ticket transcript`](/commands/server-tools/ticket/#ticket-transcript) is **on by default**. Closing or archiving attaches an HTML transcript to the log message as a file. Off stops that, but `,ticket log` still pulls one on demand, and a preset can turn it back on for its type.

<CommandBlock syntax=",ticket transcript <on|off>" example=",ticket transcript on" />

## Common issues [#common-issues]

**A preset changes nothing.** The field is probably blank, which means inherit, and the server default isn't set either.

**`,ticket reopen 3` says the ticket is archived.** Go to its channel and run `,ticket reopen` with nothing after it.

**Reopening by number asks which type.** Several types share that number. Add the type, or use the serial it listed.

**A member is blocked and won't say why.** The ticket blacklist never names the match. Check `,ticket blacklist list` or the staff log.

**Auto-archive fired with no warning.** It always warns first, so the ticket was probably archived by hand.

More fixes are on the shared [common issues](/docs/common-issues/) page.
