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, maketicket_count: type Number, scope Server Specific, starts as 0. This gives every ticket a number.
Step 2: The panel command
- Make a slash command called
ticket-panel. - Add a permissions check (search
permission): Manage Server. - On the yes path, add a message block with a button (search
button): textNeed help? Press the button.and a button called Open a ticket.
Step 3: What Open a ticket does
Under the Open a ticket button:- Do the maths on
ticket_count:+ 1. - 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.
- Name:
- 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. - Reply privately to the person:
Your ticket is open!
Step 4: What Close does
Under the Close button:- 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. - Send a message
Closing this ticket...and add a Pause for a few seconds, so people can see what happens. - 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.
