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.
$newTicketalso creates a private channel (@everyonecannot view it; the author and the bot can), but it offers no control over the permissions and has no close button.$closeTicketis flagged as an incomplete compatibility function: it deletes the current channel whenever its name containsticket, 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" ]
- Private Parent Category: Set up a Discord category where
@everyonehasView Channeldisabled. The bot and moderation roles are granted administrative or management rights. - Channel Creation: When
/ticketexecutes, create a text channel nested under this category. - Explicit Permissions: Apply an explicit permission overwrite for the member who triggered the command (
allow: 68608= View Channel + Send Messages + Read Message History). - Welcome Message & Button: Immediately send a welcome embed into the channel with an interactive button (
customId: close_ticket, Danger / Red style). - Ephemeral Confirmation: Reply to the slash command with an ephemeral message (visible only to the author) containing a clickable channel link
<#ID>. - 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
ChannelsCreate ChannelcreateChannel
ChannelsEdit Channel PermissionseditChannelPermissions
sendMessages: allow
readMessageHistory: allow
InteractionsRespond with MessagerespondWithMessage
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:
Discord Visual Preview: Dedicated Private Channel
Here is what is posted inside the #ticket-jeremy channel:
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
InteractionsRespond with MessagerespondWithMessage
Logic & FlowWaitwait
ChannelsRemove ChannelremoveChannel
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
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:
- Create a general ticket landing channel
#support-tickets. - When
/ticketis run, use the Create Thread block in that channel with Type set toprivate(any other value creates a public thread). - Add the user with the Add Thread Member block.
Events/ticket
ChannelsCreate ThreadcreateThread
ChannelsAdd Thread MemberaddThreadMember
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.