Skip to content
Blocks

Complete Guide — Support Ticket System

Building a private support system on Discord requires orchestrating channel creation, explicit permission configuration, interactive components (Discord buttons), and clean deletion upon closing.

[!NOTE] About the BibiScript helpers. $newTicket also creates a private channel (@everyone cannot view it; the author and the bot can), but it offers no control over the permissions and has no close button. $closeTicket is flagged as an incomplete compatibility function: it deletes the current channel whenever its name contains ticket, without checking who runs it. This guide builds the same flow explicitly, so you choose the category, the permissions and the close button.


1. Ticket System Architecture

To ensure total confidentiality for conversations between the user and staff:

[ Parent Category: 🔒 Private Support ]  <── @everyone: View Channel = DENIED
       │
       ├── [ Ticket Channel: #ticket-username ]
       │      ├── Staff & Bot (Inherited permissions: View, Send, Manage)
       │      ├── Ticket Creator (Explicit permission: View, Send, History)
       │      │
       │      └── [ Welcome message with Embed & Red Button "Close Ticket" ]
  1. Private Parent Category: Set up a Discord category where @everyone has View Channel disabled. The bot and moderation roles are granted administrative or management rights.
  2. Channel Creation: When /ticket executes, create a text channel nested under this category.
  3. Explicit Permissions: Apply an explicit permission overwrite for the member who triggered the command (allow: 68608 = View Channel + Send Messages + Read Message History).
  4. Welcome Message & Button: Immediately send a welcome embed into the channel with an interactive button (customId: close_ticket, Danger / Red style).
  5. Ephemeral Confirmation: Reply to the slash command with an ephemeral message (visible only to the author) containing a clickable channel link <#ID>.
  6. Closing & Deletion: When the button is clicked, acknowledge the interaction, wait 3 seconds for confirmation, then permanently delete the channel.

2. Step 1: /ticket Command (Creation & Welcome)

Events/ticket
How is the command built?
Visual (Graph)JavaScript
ChannelsCreate ChannelcreateChannel
Name*
ticket-((user.username))
Type
text
Category Id
123456789012345678
4 other fields keep their default value.
Action Key
ticket_chan
ChannelsEdit Channel PermissionseditChannelPermissions
Channel Id*
((action.ticket_chan))
Target Id*
((user.id))
Shown when Target Type = member / role
Target Type*
member
Permissions
viewChannel: allow
sendMessages: allow
readMessageHistory: allow
1 other field keeps its default value.
MessagesSend MessagesendMessage
Channel Id
((action.ticket_chan))
Content
Hello <@((user.id))>!
Shown when Message Mode = message
Embeds
Title
🎫 Support & Help
Description
Welcome to your private support channel. Please describe your issue below.
Color (int or #hex)
#5865F2
Components
Action row
• Button · Close Ticket · danger · close_ticket
7 other fields keep their default value.
InteractionsRespond with MessagerespondWithMessage
Content
✅ Your support ticket has been created: <#((action.ticket_chan))>
Ephemeral
3 other fields keep their default value.

The last three blocks depend on the channel created by the first one: they read its ID with ((action.ticket_chan)), the Action Key of Create Channel. Replace the category ID with your private support category.

The same flow written in BibiScript Code mode
;; 1. Create text channel under the private category
$var[ticketChan;$createChannel[ticket-$username;text;123456789012345678]]

;; 2. Grant permissions to creator (+viewchannel, +sendmessages, +readmessagehistory)
$editChannelPerms[$var[ticketChan];$authorID;+viewchannel;+sendmessages;+readmessagehistory]

;; 3. Send welcome embed with close button to the new channel
$useChannel[$var[ticketChan]]
$title[Support & Help]
$description[Hello <@$authorID>! Please describe your issue here.\nA support team member will assist you shortly.\n\nTo close this ticket, click the red button below.]
$color[#5865F2]
$addButton[no;close_ticket;Close Ticket;danger]

;; 4. Reset channel and acknowledge the slash command ephemerally (no double $sendMessage!)
$useChannel[]
$ephemeral
✅ Your support ticket has been created: <#$var[ticketChan]>

Discord Visual Preview: Immediate Confirmation

Here is what the user immediately sees in the channel where they ran /ticket:

🤖
Bot Creator Assistant BOT ✔ Today at 2:32 PM
✅ Your support ticket has been created: #ticket-jeremy
Only you can see this • Dismiss message

Discord Visual Preview: Dedicated Private Channel

Here is what is posted inside the #ticket-jeremy channel:

🤖
Bot Creator Assistant BOT ✔ Today at 2:32 PM
🎫 Support & Help
Hello @Jeremy! Please describe your issue below.
A member of the support team will take care of your request.

When your issue is resolved, click the button below to close the ticket.

3. Step 2: Closing the Ticket (Button Click or /ticket-close)

When a member or moderator clicks the Close Ticket button (customId: close_ticket), Discord emits the interactionCreate event.

EventsinteractionCreate core
core
Interaction Create
close_ticket
InteractionsRespond with MessagerespondWithMessage
Content
🔒 Close requested. Deleting this channel in 3 seconds...
Ephemeral
3 other fields keep their default value.
Logic & FlowWaitwait
Duration*
3s
ChannelsRemove ChannelremoveChannel
Channel Id*
((channel.id))
1 other field keeps its default value.
The same flow written in BibiScript Code mode
;; 1. Immediately acknowledge the click to prevent the Discord 3s timeout
🔒 Close requested by $username. Deleting this channel in 3 seconds...

;; 2. Clean wait timer
$wait[3s]

;; 3. Permanently delete the ticket channel
$deleteChannels[$channelID]

Discord Visual Preview: Closure Notification

🤖
Bot Creator Assistant BOT ✔ Today at 2:35 PM
🔒 Close requested by Jeremy. Deleting this channel in 3 seconds...

4. Saved Structure (reference for API and MCP users)

The blocks above are stored as a graph: one node per block, and links that say what runs next (start is the entry point, its pin is next). A block reads the result of an earlier one with ((action.<key>)), here ((action.ticket_chan)). You never write this by hand in the app; it is the format to use through the API or the MCP (validate_graph checks it).

Show the JSON of the two flows ### Ticket Creation ```json { "version": 2, "nodes": [ { "id": "n1", "type": "createChannel", "key": "ticket_chan", "enabled": true, "payload": { "name": "ticket-((user.username))", "type": "text", "categoryId": "123456789012345678" } }, { "id": "n2", "type": "editChannelPermissions", "key": "action_1", "enabled": true, "payload": { "channelId": "((action.ticket_chan))", "targetType": "member", "targetId": "((user.id))", "permissions": { "viewChannel": "allow", "sendMessages": "allow", "readMessageHistory": "allow" } } }, { "id": "n3", "type": "sendMessage", "key": "action_2", "enabled": true, "payload": { "channelId": "((action.ticket_chan))", "content": "Hello <@((user.id))>!", "embeds": [ { "title": "🎫 Support & Help", "description": "Welcome to your private support channel. Please describe your issue below.", "color": "#5865F2" } ], "components": { "components": [ { "type": "actionRow", "components": [ { "type": "button", "customId": "close_ticket", "label": "Close Ticket", "style": "danger" } ] } ] } } }, { "id": "n4", "type": "respondWithMessage", "key": "action_3", "enabled": true, "payload": { "content": "✅ Your support ticket has been created: <#((action.ticket_chan))>", "ephemeral": true } } ], "links": [ { "from": { "node": "start", "pin": "next" }, "to": "n1" }, { "from": { "node": "n1", "pin": "next" }, "to": "n2" }, { "from": { "node": "n2", "pin": "next" }, "to": "n3" }, { "from": { "node": "n3", "pin": "next" }, "to": "n4" } ], "data": [] } ``` ### Ticket Closing ```json { "version": 2, "nodes": [ { "id": "n1", "type": "respondWithMessage", "key": "action_0", "enabled": true, "payload": { "content": "🔒 Close requested. Deleting this channel in 3 seconds...", "ephemeral": false } }, { "id": "n2", "type": "wait", "key": "action_1", "enabled": true, "payload": { "duration": "3s" } }, { "id": "n3", "type": "removeChannel", "key": "action_2", "enabled": true, "payload": { "channelId": "((channel.id))" } } ], "links": [ { "from": { "node": "start", "pin": "next" }, "to": "n1" }, { "from": { "node": "n1", "pin": "next" }, "to": "n2" }, { "from": { "node": "n2", "pin": "next" }, "to": "n3" } ], "data": [] } ```

5. Lightweight Alternative: Tickets via Private Threads

If your server is approaching Discord’s 500-channel limit, or if you prefer keeping history organized without creating entire text channels, you can use private threads:

  1. Create a general ticket landing channel #support-tickets.
  2. When /ticket is run, use the Create Thread block in that channel with Type set to private (any other value creates a public thread).
  3. Add the user with the Add Thread Member block.
Events/ticket
How is the command built?
Visual (Graph)JavaScript
ChannelsCreate ThreadcreateThread
Channel Id
123456789012345678
Name*
ticket-((user.username))
Type
private
4 other fields keep their default value.
Action Key
ticket_thread
ChannelsAdd Thread MemberaddThreadMember
Thread Id*
((action.ticket_thread))
User Id*
((user.id))

To archive and close the ticket without destroying it, the engine’s Update Channel block reads archived and locked payload keys for a thread. The editor does not show these two fields, so set them through the API or the MCP.