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

# Tickets

> An Open a ticket button that makes a private channel, with a Close button.

Members press **Open a ticket**. Your bot makes a **private channel** just for them and your staff. When the problem is solved, someone presses **Close** and the channel is deleted.

## Before you start

* Make a **category** in your server called `Tickets`.
* Make a **Staff** role.
* Your bot needs the **Manage Channels** permission.

## Step 1: Make a counter

On the **Database** page, make `ticket_count`: type **Number**, scope **Server Specific**, starts as `0`. This gives every ticket a number.

## Step 2: The panel command

1. Make a slash command called `ticket-panel`.
2. Add a **permissions** check (search `permission`): **Manage Server**.
3. On the yes path, add a message block with a **button** (search `button`): text `Need help? Press the button.` and a button called **Open a ticket**.

## Step 3: What Open a ticket does

Under the **Open a ticket** button:

1. **Do the maths** on `ticket_count`: `+ 1`.
2. Add the block that **creates a channel** (search `create a channel`):
   * Name: `ticket-{DBVAR_ticket_count}`
   * Put it in the **Tickets** category.
   * Let only the person who pressed the button and the **Staff** role see it.
3. Add a message block that sends **into the new channel**, with a **Close** button: `Hi {user_displayName}! Tell us what's wrong. Staff will be here soon.`
4. **Reply** privately to the person: `Your ticket is open!`

## Step 4: What Close does

Under the **Close** button:

1. Optional: add the block that **saves a transcript** (search `transcript`) and send it to a staff log channel, so you keep a copy of the chat. This block needs Premium.
2. Send a message `Closing this ticket...` and add a **Pause** for a few seconds, so people can see what happens.
3. Add the block that **deletes a channel** (search `delete a channel`) and pick the current channel.

## Make it yours

* Ask a question first: add a **pop-up form** under Open a ticket ("What do you need help with?") and post the answer in the new channel.
* Stop people opening ten tickets: save a **User -> True / False** variable `has_ticket`, check it with **Compare** before making a channel, and set it back to false when the ticket closes.


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