BDFD Advanced

BDFD Cenzo.tz Ticket System

A fully advanced ticket system built for BDFD with interactive config panel, JSON-based settings, modal inputs, dynamic message placeholders, and complete ticket lifecycle controls — including transcript support.

Features

Components V2 UI JSON-based config Modal ticket creation Custom message placeholders Close / Reopen / Delete Transcript support

1. Ticket Config

Configures the ticket system: category, staff role, transcript channel, and custom ticket message.

TRIGGER <prefix>ticket-config
$c[ hi i'm cenzo.tz if you're trying to repost this shit without asking me i'll make sure to goon on you thanks!]
$c[ join my discord server for api support https://discord.gg/acd2sTKHtW]

$nomention
$allowRoleMentions[]
$c[made by cenzo.tz if repost give credits]
$onlyPerms[manageserver; **$username**, You don't have **Manage Server** Permission!]

$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$addContainer[cont]

$addSection[sec;cont]
$addTextDisplay[# Ticket Config
The ticket settings can be configured here.;sec]
$addThumbnail[$serverIcon[$guildID];;false;sec]

$addSeparator[true;small;cont]

$addTextDisplay[**Ticket Category**: $replaceText[$replaceText[$checkCondition[$json[ct]==];true;Not Set];false;<#$json[ct]>];cont]
$addTextDisplay[* The category where tickets will be created.;cont]

$addActionRow[row1;cont]
$addChannelSelect[ticket setup category $authorID;Choose an category;1;1;false;row1;category]

$addSeparator[true;small;cont]

$addTextDisplay[**Ticket Staff**: $replaceText[$replaceText[$checkCondition[$json[staff]==];true;Not Set];false;<@&$json[staff]>];cont]
$addTextDisplay[* The role that takes care of tickets, the role will get mentioned when someone creates a ticket.;cont]

$addActionRow[row2;cont]
$addRoleSelect[ticket setup staff $authorID;Choose an staff role;1;1;false;row2]

$addSeparator[true;small;cont]

$addTextDisplay[**Transcript Channel**: $replaceText[$replaceText[$checkCondition[$json[transcriptchannel]==];true;Not Set];false;<#$json[transcriptchannel]>];cont]
$addTextDisplay[* The channel where transcripts will be sent.;cont]

$addActionRow[row3;cont]
$addChannelSelect[ticket setup channel $authorID;Choose an channel;1;1;false;row3;text]

$addSeparator[true;small;cont]

$addTextDisplay[**Custom Ticket Message**: $replaceText[$replaceText[$checkCondition[$json[customMessage]==];true;Not set];false;Set];cont]
$addTextDisplay[* This message will be sent inside the ticket.;cont]

$addActionRow[row4;cont]
$addButtonCV2[ticket setup customMessage $authorID;Set Custom Message;primary;false;;row4]

2. Ticket Panel

Sends the ticket panel embed with up to 3 configurable buttons. Requires config to be set up first.

TRIGGER <prefix>ticket-panel
$onlyIf[$guildID!=;]

$c[ join my discord server for api support https://discord.gg/acd2sTKHtW]

$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$onlyIf[$json[ct]!=;please setup ticket config first!]

$async[Making]

$if[$message[title]==]
$var[title;Ticket Panel]
$else
$var[title;$message[title]]
$endif

$if[$message[description]==]
$var[desc;Click below to create a ticket.]
$else
$var[desc;$message[description]]
$endif

$var[message.id;$sendEmbedMessage[
$channelID;
;
$var[title];
;
$var[desc];
00eeff;
;
;
;
;
;
;
no;
yes
]]

$endasync
$await[Making]

$async[Adding]

$addButton[no;ticket panel button 1;$message[button1];secondary;no;;$var[message.id]]

$if[$message[button2]!=]
$addButton[no;ticket panel button 2;$message[button2];secondary;no;;$var[message.id]]
$endif

$if[$message[button3]!=]
$addButton[no;ticket panel button 3;$message[button3];secondary;no;;$var[message.id]]
$endif

$endasync
$await[Adding]

$ephemeral
$title[$serverName[$guildID]]
$description[Successfully created ticket panel embed.
$addTimestamp]
$color[00eeff]

3. $onInteraction — Setup & Trigger

Handles config panel interactions (dropdowns, message modal) and shows the ticket creation modal when a panel button is clicked.

TRIGGER $onInteraction
$nomention
$allowRoleMentions[]

$c[ join my discord server for api support https://discord.gg/acd2sTKHtW]

$if[$customID==custommsg_submit]

$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$jsonSetString[customMessage;$input[msg]]
$setUserVar[ticketConfig;$jsonStringify;$botID]

$reply
Custom message saved.

$stop
$endif


$if[$checkContains[$customID;ticket panel button]]

$if[$getUserVar[ticketc]==1]
$ephemeral
You already have ticket open!
$removeButtons
$stop
$endif

$setServerVar[untitled;$sum[$getServerVar[untitled];1]]

$newModal[modal;Why are you creating this ticket?]
$addTextInput[modalInput1;short;Why do you want to make a ticket?;1;100;yes;;E.g support/help]

$elseif[$checkContains[$customID;ticket setup]]

$if[$checkContains[$customID;$authorID]==false]
$ephemeral
$removeAllComponents
This interaction is not for you!! loser!!
$c[CHANGE THIS ERROR MESSAGE LATER]
$stop

$elseif[$checkUserPerms[$authorID;manageserver]==false]
$c[foiled]
$ephemeral
$removeAllComponents
You don't have enough permissions to interact with this panel!
$stop
$endif

$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$if[$checkContains[$customID;customMessage]]
$newModal[custommsg_submit;Set Custom Ticket]
$addTextInput[msg;paragraph;Enter ticket message;1;1000;yes;;You can use {username}, {mention}, etc.]

$elseif[$checkContains[$customID;category]]
$jsonSetString[ct;$getChannelSelectChannelID[1]]

$elseif[$checkContains[$customID;staff]]
$jsonSetString[staff;$getRoleSelectRoleID[1]]

$elseif[$checkContains[$customID;channel]]
$jsonSetString[transcriptchannel;$getChannelSelectChannelID[1]]
$endif

$setUserVar[ticketConfig;$jsonStringify;$botID]


$if[$customID!=ticket setup customMessage $authorID]

$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$addContainer[cont]

$addSection[sec;cont]
$addTextDisplay[# Ticket Config
The ticket settings can be configured here.;sec]
$addThumbnail[$serverIcon[$guildID];;false;sec]

$addSeparator[true;small;cont]

$addTextDisplay[**Ticket Category**: $replaceText[$replaceText[$checkCondition[$json[ct]==];true;Not Set];false;<#$json[ct]>];cont]
$addTextDisplay[* The category where tickets will be created.;cont]

$addActionRow[row1;cont]
$addChannelSelect[ticket setup category $authorID;Choose an category;1;1;false;row1;category]

$addSeparator[true;small;cont]

$addTextDisplay[**Ticket Staff**: $replaceText[$replaceText[$checkCondition[$json[staff]==];true;Not Set];false;<@&$json[staff]>];cont]
$addTextDisplay[* The role that takes care of tickets, the role will get mentioned when someone creates a ticket.;cont]

$addActionRow[row2;cont]
$addRoleSelect[ticket setup staff $authorID;Choose an staff role;1;1;false;row2]

$addSeparator[true;small;cont]

$addTextDisplay[**Transcript Channel**: $replaceText[$replaceText[$checkCondition[$json[transcriptchannel]==];true;Not Set];false;<#$json[transcriptchannel]>];cont]
$addTextDisplay[* The channel where transcripts will be sent.;cont]

$addActionRow[row3;cont]
$addChannelSelect[ticket setup channel $authorID;Choose an channel;1;1;false;row3;text]

$addSeparator[true;small;cont]

$addTextDisplay[**Custom Ticket Message**: $replaceText[$replaceText[$checkCondition[$json[customMessage]==];true;Not set];false;Set];cont]
$addTextDisplay[* This message will be sent inside the ticket.;cont]

$addActionRow[row4;cont]
$addButtonCV2[ticket setup customMessage $authorID;Set Custom Message;primary;false;;row4]

$endif
$endif

4. $onInteraction — Ticket Lifecycle

Handles ticket creation from modal submission, and all ticket controls: close, reopen, delete, and transcript generation.

TRIGGER $onInteraction
$nomention
$c[made by cenzo.tz if repost give credits]

$c[ join my discord server for api support https://discord.gg/acd2sTKHtW]


$try
$jsonParse[$getUserVar[ticketConfig;$botID]]
$catch
$jsonParse[{}]
$endtry

$if[$checkUserPerms[$botID;managechannels]==false]
$description[i dont have **manage channels** permission]
$stop
$endif

$if[$customID==modal]

$if[$getServerVar[untitled]<10]
$var[eh;00]
$elseif[$getServerVar[untitled]<100]
$var[eh;0]
$else
$var[eh;]
$endif

$var[text;$replaceText[$replaceText[$checkCondition[$json[customMessage]==];true;blah blah will you ];false;$json[customMessage]]]
$var[thumb;]

$if[$checkContains[$var[text];{avatar}]==true]
$var[thumb;$userAvatar[$authorID]]
$var[text;$replaceText[$var[text];{avatar};]]
$endif

$var[img;]
$if[$checkContains[$var[text];{servericon}]==true]
$var[img;$serverIcon[$guildID]]
$var[text;$replaceText[$var[text];{servericon};]]
$endif

$var[color;00eeff]

$if[$checkContains[$var[text];{color:#]==true]
$textSplit[$var[text];{color:#]
$textSplit[$splitText[2];}]
$var[color;$splitText[1]]
$var[text;$replaceText[$var[text];{color:#$var[color]};]]
$endif

$var[text;$replaceText[$var[text];{username};$username]]
$var[text;$replaceText[$var[text];{displayname};$displayName]]
$var[text;$replaceText[$var[text];{userid};$authorID]]
$var[text;$replaceText[$var[text];{usertag};$discriminator[$authorID]]]
$var[text;$replaceText[$var[text];{mention};<@$authorID>]]

$var[text;$replaceText[$var[text];{server};$serverName[$guildID]]]
$var[text;$replaceText[$var[text];{serverid};$guildID]]
$var[text;$replaceText[$var[text];{servericon};$serverIcon[$guildID]]]
$var[text;$replaceText[$var[text];{membercount};$membersCount]]

$var[text;$replaceText[$var[text];{channel};<#$channelID>]]
$var[text;$replaceText[$var[text];{channelname};$channelName[$channelID]]]

$var[text;$replaceText[$var[text];{time};$hour:$minute:$second]]
$var[text;$replaceText[$var[text];{date};$day/$month/$year]]

$var[au;$authorID]

$createChannel[ticket-$var[eh]$getServerVar[untitled];text;$json[ct]]
$var[ch;$findChannel[ticket-$var[eh]$getServerVar[untitled]]]
$modifyChannelPerms[$var[ch];+readmessages;+readmessagehistory;+sendmessages;$authorID]
$modifyChannel[$var[ch];!unchanged;$authorID;!unchanged;!unchanged;$json[ct]]

$setUserVar[ticketc;1;$authorID;$guildID]

$var[msg;$sendEmbedMessage[$var[ch];<@&$json[staff]>;;$var[text];$var[color];;;;;$var[thumb];$var[img];no;yes]]

$useChannel[$var[ch]]
$addButton[no;close;Close 🔒;danger;no;;$var[msg]]

$ephemeral
$removeButtons
$description[You opened a ticket! <#$var[ch]>]
$color[00eeff]

$endif



$if[$customID==close]

$ephemeral
you closed the ticket!
$setUserVar[ticketc;0;$authorID;$guildID]

$var[id;$sendEmbedMessage[$channelID;;;;ticket closed by **$username**;;;;;;;;no;yes]]

$removeButtons
$addButton[no;delete;Delete 🗑️;danger;no;;$var[id]]
$addButton[no;reopen;Re-open 🔓;secondary;no;;$var[id]]
$addButton[no;transcript; Transcript 📝;secondary;no;;$var[id]]

$editChannelPerms[$channelID;$channelTopic;-readmessages]

$endif



$if[$customID==reopen]

Sucessfully reopned ticket and added <@$channelTopic> back!
$editChannelPerms[$channelID;$channelTopic;+readmessages;+sendmessages]
$removeButtons
$setUserVar[ticketc;1;$channelTopic;$guildID]

$endif



$if[$customID==delete]

$setUserVar[ticketc;0;$channelTopic;$guildID]
$sendEmbedMessage[$channelID;;;;Deleting ticket in **5s**;FF2800;;;Thanks for choosing $username[$botID];$userAvatar[$botID];$serverIcon[$guildID];;;]
$replyIn[5s]
$deleteChannels[$channelID]

$endif



$if[$customID==transcript]
$sendMessage[generating transcript…]

$httpPost[https://ulquiorracifer.xyz/api/transcript;
{
  "botToken":"$getVar[BotToken]",
  "channelId":"$channelID",
  "ownerId":"$channelTopic",
  "transcriptChannelId":"$json[transcriptchannel]"
}
]

$endif

Custom Message Placeholders

These tags can be used inside your custom ticket message and are dynamically replaced when a ticket is created.

User

{username} User's username
{displayname} Server nickname
{userid} User ID
{usertag} Discriminator
{mention} Mentions user
{avatar} Embed thumbnail

Server

{server} Server name
{serverid} Server ID
{servericon} Server icon URL
{membercount} Total members

Time & Misc

{channel} Channel mention
{channelname} Channel name
{time} HH:MM:SS
{date} DD/MM/YYYY
{color:#HEX} Embed color

Variables Needed

ticketConfig (empty)
BotToken YOUR BOT TOKEN
ticketc 0
untitled 0

Credits

CT
@cenzo.tz
Script Creator

Support Server

discord.gg/acd2sTKHtW

If you repost or redistribute this system, please give proper credits to the original creator.