What you'll build
Members press Open a ticket. Your bot makes a private channel just for them and your staff, with a number like
ticket-12. 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.
The variables to make
Or add Ticket counter from What do you want to make? on the Database page./ticket-panel
1
Make the command
A Slash command called
ticket-panel.2
Staff only
Add the check that looks at permissions (search
permission): Manage Server. Under its Else block: Reply Only staff can post the panel.3
The panel: straight under the check
Add a message block with a button (search
button): text Need help? Press the button. and a button called Open a ticket.What Open a ticket does
Under the Open a ticket button:1
One ticket at a time
Add Compare: is
{DBVAR_has-ticket} equal to true? Straight under it: Reply privately You already have a ticket open.2
Count it: under the Else block
Do the maths on
ticket-count: var + 1.3
Remember they have one
Save a value on
has-ticket, Whose variable The member who started this, Value true.4
Make the channel
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.
5
Say hello in the new channel
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.6
Tell the member
Reply privately to the person:
Your ticket is open!What Close does
Under the Close button:1
Keep a copy (optional, Premium)
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
Let them open a new one later
Save a value on
has-ticket, Whose variable The member who started this, Value false.3
Warn, then wait
Send a message
Closing this ticket... and add a Pause for a few seconds, so people can see what happens.4
Delete the channel
Add the block that deletes a channel (search
delete a channel) and pick the current channel.Try it
- Type
/ticket-panelin your help channel. - Press Open a ticket. A channel called
ticket-1appears in Tickets. - Press Open a ticket again. The bot says you already have one.
- Press Close in the ticket. The channel is deleted after a few seconds.
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. See Pop-up forms.
- Ping staff: put
{^Staff}in the hello message.
