BDFD_Berk

New Advanced Ticket System | Bot Designer For Discord: Guide

Oct 20th, 2021 (edited)
12,547
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.37 KB | None | 1 0
  1. Don't forget to join the Basement Developers server for more stuff like this :)
  2. https://dsc.gg/codes
  3. or
  4. https://discord.gg/xrq3DpYE7J
  5.  
  6. Hey! i'm Berk#3506, here's the Ticket System from the video of the "Bot Designer For Discord: Guide" channel :)
  7. They're 6 codes in total! but first, you need the following variables, the last three has an empty value:
  8.  
  9. ticketsystem
  10. value=no
  11. tickets
  12. value=0
  13. ticketcategory
  14. value=
  15. ticketstaff
  16. value=
  17. userticket
  18. value=
  19.  
  20. After you add the variables, start adding the codes, all the codes requires BDscript 2, literally ALL of them, i will separate the codes with a big separator (======================================) so you can add them easily, here we go, as i said, they're 6 in total:
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. ===================================== FIRST CODE, THE TRIGGER MUST BE "(YOURPREFIX)ticket"! AND ENABLE BDSCRIPT 2 MODE:
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. $nomention
  36. $c[Restrictions: Ticket Disabled]
  37. $c[If the system is disabled, then the command won't work and it will return the error after the ";"]
  38. $onlyIf[$getServerVar[ticketsystem]!=no;Sorry! the ticket system is disabled on this server, tell an admin to type +enable-tickets to enable it!]
  39. $c[Restrictions: Permissions]
  40. $c[If the bot don't have Manage Channels permissions to create the ticket channel, it will return the error after the ";"]
  41. $onlyBotPerms[managechannels;Sorry! I don't have enough permissions to create the ticket, tell an admin to give me "manage channels" permissions!]
  42. $c[Restrictions: Tickets limit]
  43. $c[If the user already has a ticket created, then it will return an error]
  44.  
  45. $c[Checkers: variables]
  46. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  47. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  48. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  49. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  50. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  51.  
  52. $if[$channelExists[$getUserVar[userticket]]==true]
  53. $if[$checkContains[$channelTopic[$getUserVar[userticket]];Closed & Saved]==false]
  54. $onlyIf[2==5;Hey **$username[$authorID]**! you already own a open ticket, please move to <#$getUserVar[userticket]>] $c[don't delete this, it's actually important]
  55. $endif
  56. $endif
  57.  
  58. $c[This creates the ticket]
  59. $async[ticket1]
  60. $if[$getServerVar[ticketcategory]==]
  61. $createChannel[ticket-00$sum[$getServerVar[tickets];1];text]
  62. $else
  63. $createChannel[ticket-00$sum[$getServerVar[tickets];1];text;$getServerVar[ticketcategory]]
  64. $endif
  65. $endasync
  66.  
  67. $await[ticket1]
  68.  
  69. $c[This sends an embed into the ticket]
  70. $setUserVar[userticket;$channelID[ticket-00$sum[$getServerVar[tickets];1]]]
  71. $useChannel[$channelID[ticket-00$sum[$getServerVar[tickets];1]]]
  72. $c[And the embed is the one below]
  73. $author[New ticket!]
  74. $color[ed3491]
  75. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  76. $description[
  77. Hey <@$authorID>, this is your ticket!
  78.  
  79. Please, state down below your whole problem,
  80. provide any detail you can so the staff can help you faster.
  81. Our staff team will answer soon as possible!
  82.  
  83. Please run `+close` when your problem has been solved
  84. or use the "close" red button below.
  85.  
  86. Be patient till a staff check your ticket!
  87.  
  88. 🔒 **Close**
  89. You or the staff can use this button to close the ticket.
  90.  
  91. ✋ **Claim**
  92. The staff can use this button to claim the ticket.
  93. Who claims the ticket will be the only one able to close it.
  94.  
  95. > Ticket subject: $replaceText[$replaceText[%$checkCondition[$message==]%;%true%;`Not provided`!;1];%false%;`$message`;1]]
  96. $footer[$username[$botID] ticket system]
  97. $addTimestamp
  98. $c[This adds the buttons]
  99. $addButton[no;closeticket;Close;danger;no;🔒]
  100. $addButton[no;claimticket;Claim (staff);secondary;no;✋]
  101.  
  102. $c[This sends an embed saying that the ticket has been created]
  103. $sendEmbedMessage[$channelID;;;;**$username[$authorID]#$discriminator[$authorID]** You successfully created the ticket <#$channelID[ticket-00$sum[$getServerVar[tickets];1]]>!;ed3491;;;$username[$botID] ticket system;;$c[thumbnail];;;no]
  104.  
  105. $c[This changes the ticket description, don't touch this, or the code may break]
  106. $if[$getServerVar[ticketcategory]!=]
  107. $modifyChannel[$channelID[ticket-00$sum[$getServerVar[tickets];1]];!unchanged;Ticket opened by "$username[$authorID]#$discriminator[$authorID]";no;!unchanged]
  108. $else
  109. $modifyChannel[$channelID[ticket-00$sum[$getServerVar[tickets];1]];!unchanged;Ticket opened by "$username[$authorID]#$discriminator[$authorID]";no;!unchanged;$getServerVar[ticketcategory]]
  110. $endif
  111.  
  112. $c[This sets the ticket permissions]
  113. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];-readmessages;$guildID] $c[This deny the permission to view the ticket to everyone]
  114. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];+readmessages;$authorID] $c[This allows the permission to view the ticket to the user that creates the ticket]
  115. $if[$roleExists[$getServerVar[ticketstaff]]==true] $c[This checks if the staff role has been set... and if it exists then...]
  116. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];+readmessages;$getServerVar[ticketstaff]] $c[This allows the permission to view the ticket to the staff role]
  117. $endif
  118.  
  119. $c[This sets the tickets amount variable, it's more important than you think so don't delete it :)]
  120.  
  121. $setServerVar[tickets;$sum[$getServerVar[tickets];1]]
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. ===================================== SECOND CODE, THE TRIGGER MUST BE "$onInteraction" (don't change it)! AND ENABLE BDSCRIPT 2 MODE, THIS IS A VERY LONG CODE, BUT IGNORE THE 2K CHARACTERS WARNING!:
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. $nomention
  138. $c[IMPORTANT: Enable BDscript 2 mode or it may not work!]
  139. $c[
  140. Stuff you need to know:
  141. - This system won't work if your bot don't have "Manage channels" perms, this is obvious!
  142. - This code may have a few minor bugs that i wasn't able to fix, however these are not dangerous
  143. - You can't save the ticket transcript in a file, that's not possible
  144. - You can't make the ticket close automaticly after X amount of time of inactivity
  145. - Once you click the "Just close" button, the ticket will close without any warning or timer, as it's a "confirmation" button
  146. - Don't edit the code functions, you can edit the content on the embeds but don't edit any sensitive function
  147. ]
  148. $c[
  149. Variables required:
  150. "ticketsystem" with value: "no"
  151. "tickets" with value: "0"
  152. "ticketcategory" without value
  153. "ticketstaff" without value
  154. "userticket" without value
  155. ]
  156.  
  157. $c[Checkers: variables]
  158. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  159. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  160. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  161. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  162. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  163.  
  164. $c[
  165. This system may be updated again in the future,
  166. to know about next updates or bug fixes just periodically check out the channel,
  167. or just subscribe and enable the bell :)
  168. You can also DM me, Berk#3506
  169. ]
  170. $c[ EDITABLE SETTINGS ]
  171.  
  172. $var[prefix;+] $c[YOUR BOT PREFIX, IN THIS CASE I USED "+" AS EXAMPLE]
  173. $var[color;ed3491] $c[ANY HEXCODE COLOUR, I USED "#ed3491" AS EXAMPLE]
  174.  
  175. $c[ EDITABLE SETTINGS ]
  176.  
  177. $if[$customID==closeticket]
  178. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  179. $removeComponent[closeticket]
  180. $removeComponent[claimticket]
  181. $addButton[no;justclose;Just close;danger;no;🔐]
  182. $if[$checkContains[$channelTopic;Closed & Saved]==false]
  183. $addButton[no;closeandsave;Close & Save;primary;no;💾]
  184. $else
  185. $addButton[no;closeandsave;Closed & Saved;primary;yes;💾]
  186. $addButton[no;openagain;Open Ticket;success;no;🔑]
  187. $endif
  188. $addButton[no;justcancel;Cancel;secondary;no;🔖]
  189.  
  190. $author[Are you sure? pick an option]
  191. $description[
  192. Hey **$username[$authorID]#$discriminator[$authorID]** do you really want to close the ticket?
  193.  
  194. 🔐 **Just close**
  195. Just close the ticket, without saving any content inside it, this action can't be undone.
  196. 💾 **Close & Save**
  197. Close the ticket, but save the channel, it removes the user permissions to view the ticket.
  198. 🔖 **Cancel**
  199. Don't close the ticket.
  200. ]
  201. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  202. $color[$var[color]]
  203. $footer[$username[$botID] ticket system]
  204. $endif
  205.  
  206. $if[$customID==justclose]
  207. $if[$checkContains[$channelTopic;claimed]==false]
  208. $deleteChannels[$channelID]
  209. $else
  210. $if[$checkContains[$channelTopic;claimed by $username[$authorID]#$discriminator[$authorID]]==true]
  211. $deleteChannels[$channelID]
  212. $else
  213. $sendEmbedMessage[$channelID;<@$authorID>;;;Sorry, but another staff already claimed this ticket, only the staff that claimed the ticket can close it.;$var[color];Action denied;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  214. $endif
  215. $endif
  216. $endif
  217.  
  218. $if[$customID==closeandsave]
  219. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  220. $if[$getServerVar[ticketstaff]==]
  221. $onlyPerms[kick;**$username** | Sorry, you need 'kick' permissions to execute this! or you need the staff role, which isn't set (tell an admin to do $var[prefix]set-staff-role <role>!)]
  222. $else
  223. $onlyIf[$hasRole[$authorID;$getServerVar[ticketstaff]]==true;**$username** | Sorry, only the staff can use this button!]
  224. $endif
  225. $if[$checkContains[$channelTopic;claimed]==false]
  226. $modifyChannelPerms[$channelID;-readmessages;$findUser[$splitText[2]]]
  227. $removeComponent[justcancel]
  228. $sendEmbedMessage[$channelID;<@$authorID>;;;This ticket has been closed & saved, the user don't have access to it anymore! i'll save this channel till you use the "just close" button.;$var[color];Ticket Closed;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  229. $if[$getServerVar[ticketcategory]==]
  230. $modifyChannel[$channelID;!unchanged;$channelTopic | Ticket Closed & Saved;no;!unchanged]
  231. $else
  232. $modifyChannel[$channelID;!unchanged;$channelTopic | Ticket Closed & Saved;no;!unchanged;$getServerVar[ticketcategory]]
  233. $endif
  234. $onlyBotPerms[managechannels;Please give me managechannels permissions, otherwise i can't take actions in the ticket.]
  235. $editButton[closeandsave;Closed & Saved;primary;yes;💾]
  236. $addButton[no;openagain;Open Ticket;success;no;🔑]
  237. $author[Ticket Solved]
  238. $description[
  239. Here are some options that you, the staff, can use.
  240.  
  241. 🔐 **Just close**
  242. Just close the ticket, without saving any content inside it, this action can't be undone.
  243. 🔑 **Open Ticket**
  244. Open the ticket, the user will be able to view the ticket again.
  245.  
  246. > **This ticket has been closed & saved by $username[$authorID]#$discriminator[$authorID]**!]
  247. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  248. $color[$var[color]]
  249. $footer[$username[$botID] ticket system]
  250. $else
  251. $if[$checkContains[$channelTopic;claimed by $username[$authorID]#$discriminator[$authorID]]==true]
  252. $modifyChannelPerms[$channelID;-readmessages;$findUser[$splitText[2]]]
  253. $sendEmbedMessage[$channelID;<@$authorID>;;;This ticket has been closed & saved, the user don't have access to it anymore! i'll save this channel till you use the "just close" button.;$var[color];Ticket Closed;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  254. $if[$getServerVar[ticketcategory]==]
  255. $modifyChannel[$channelID;!unchanged;$channelTopic | Ticket Closed & Saved;no;!unchanged]
  256. $else
  257. $modifyChannel[$channelID;!unchanged;$channelTopic | Ticket Closed & Saved;no;!unchanged;$getServerVar[ticketcategory]]
  258. $endif
  259. $onlyBotPerms[managechannels;Please give me managechannels permissions, otherwise i can't take actions in the ticket.]
  260. $editButton[closeandsave;Closed & Saved;primary;yes;💾]
  261. $addButton[no;openagain;Open Ticket;success;no;🔑]
  262. $author[Ticket Solved]
  263. $description[
  264. Here are some options that you, the staff, can use.
  265.  
  266. 🔐 **Just close**
  267. Just close the ticket, without saving any content inside it, this action can't be undone.
  268. 🔑 **Open Ticket**
  269. Open the ticket, the user will be able to view the ticket again.
  270.  
  271. > **This ticket has been closed & saved by $username[$authorID]#$discriminator[$authorID]**!]
  272. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  273. $color[$var[color]]
  274. $footer[$username[$botID] ticket system]
  275. $else
  276. $sendEmbedMessage[$channelID;<@$authorID>;;;Sorry, but another staff already claimed this ticket, only the staff that claimed the ticket can close it.;$var[color];Action denied;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  277. $endif
  278. $endif
  279. $endif
  280.  
  281. $if[$customID==justcancel]
  282. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  283. $author[Ticket Panel]
  284. $description[
  285. Please, state down below your whole problem,
  286. provide any detail you can so the staff can help you faster.
  287. Our staff team will answer soon as possible!
  288.  
  289. Please run `$var[prefix]close` when your problem has been solved
  290. or use the "close" red button below.
  291.  
  292. Be patient till a staff check your ticket!
  293.  
  294. 🔒 **Close**
  295. You or the staff can use this button to close the ticket.
  296.  
  297. ✋ **Claim**
  298. The staff can use this button to claim the ticket.
  299. Who claims the ticket will be the only one able to close it.
  300. ]
  301. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  302. $color[$var[color]]
  303. $footer[$username[$botID] ticket system]
  304. $removeComponent[justclose]
  305. $removeComponent[closeandsave]
  306. $removeComponent[justcancel]
  307. $addButton[no;closeticket;Close;danger;no;🔒]
  308. $if[$checkContains[$channelTopic;claimed]==false]
  309. $addButton[no;claimticket;Claim (staff);secondary;no;✋]
  310. $else
  311. $addButton[no;claimticket;Claimed;secondary;yes;✋]
  312. $endif
  313. $endif
  314.  
  315. $if[$customID==claimticket]
  316. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  317. $if[$getServerVar[ticketstaff]==]
  318. $onlyPerms[kick;**$username** | Sorry, you need 'kick' permissions to execute this! or you need the staff role, which isn't set (tell an admin to do $var[prefix]set-staff-role <role>!)]
  319. $else
  320. $onlyIf[$hasRole[$authorID;$getServerVar[ticketstaff]]==true;**$username** | Sorry, only the staff can use this button!]
  321. $endif
  322. $author[Ticket Panel]
  323. $description[
  324. Please, state down below your whole problem,
  325. provide any detail you can so the staff can help you faster.
  326. Our staff team will answer soon as possible!
  327.  
  328. Please run `$var[prefix]close` when your problem has been solved
  329. or use the "close" red button below.
  330.  
  331. Be patient till a staff check your ticket!
  332.  
  333. 🔒 **Close**
  334. You or the staff can use this button to close the ticket.
  335.  
  336. ✋ **Claim**
  337. The staff can use this button to claim the ticket.
  338.  
  339. > **This ticket has been claimed by $username[$authorID]#$discriminator[$authorID]**!]
  340. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  341. $color[$var[color]]
  342. $footer[$username[$botID] ticket system]
  343. $editButton[claimticket;Claimed;secondary;yes;✋]
  344. $if[$getServerVar[ticketcategory]==]
  345. $modifyChannel[$channelID;!unchanged;$channelTopic | claimed by $username[$authorID]#$discriminator[$authorID];no;!unchanged]
  346. $else
  347. $modifyChannel[$channelID;!unchanged;$channelTopic | claimed by $username[$authorID]#$discriminator[$authorID];no;!unchanged;$getServerVar[ticketcategory]]
  348. $endif
  349. $onlyBotPerms[managechannels;Please give me managechannels permissions, otherwise i can't take actions in the ticket.]
  350. $endif
  351.  
  352. $if[$customID==openagain]
  353. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  354. $if[$getServerVar[ticketstaff]==]
  355. $onlyPerms[kick;**$username** | Sorry, you need 'kick' permissions to execute this! or you need the staff role, which isn't set (tell an admin to do $var[prefix]set-staff-role <role>!)]
  356. $else
  357. $onlyIf[$hasRole[$authorID;$getServerVar[ticketstaff]]==true;**$username** | Sorry, only the staff can use this button!]
  358. $endif
  359. $author[Ticket Panel]
  360. $description[
  361. Please, state down below your whole problem,
  362. provide any detail you can so the staff can help you faster.
  363. Our staff team will answer soon as possible!
  364.  
  365. Please run `$var[prefix]close` when your problem has been solved
  366. or use the "close" red button below.
  367.  
  368. Be patient till a staff check your ticket!
  369.  
  370. 🔒 **Close**
  371. You or the staff can use this button to close the ticket.
  372.  
  373. ✋ **Claim**
  374. The staff can use this button to claim the ticket.
  375. Who claims the ticket will be the only one able to close it.
  376. ]
  377. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  378. $color[$var[color]]
  379. $footer[$username[$botID] ticket system]
  380. $editButton[closeandsave;Close & Save;primary;no;💾]
  381. $removeComponent[openagain]
  382. $sendEmbedMessage[$channelID;<@$authorID>;;;This ticket is now open, the user has access to it.;$var[color];Ticket Open;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  383. $modifyChannelPerms[$channelID;+readmessages;$findUser[$splitText[2]]]
  384. $modifyChannelPerms[$channelID;-readmessages;$guildID]
  385. $if[$roleExists[$getServerVar[ticketstaff]]==true]
  386. $modifyChannelPerms[$channelID;+readmessages;$getServerVar[ticketstaff]]
  387. $endif
  388. $endif
  389.  
  390. $textSplit[$channelTopic;"]
  391.  
  392. $if[$customID==openticket]
  393. $nomention
  394. $if[$channelExists[$getUserVar[userticket]]==true]
  395. $if[$checkContains[$channelTopic[$getUserVar[userticket]];Closed & Saved]==false]
  396. $onlyIf[2==5;] $c[don't delete this, it's actually important]
  397. $endif
  398. $endif
  399. $c[Restrictions]
  400. $c[If the system is disabled]
  401. $onlyIf[$getServerVar[ticketsystem]!=no;Sorry! the ticket system is disabled on this server, tell an admin to type $var[prefix]enable-tickets to enable it!]
  402. $c[If the bot don't have Manage Channels permissions to create the ticket channel, it will return the error after the ";"]
  403. $onlyBotPerms[managechannels;Sorry! I don't have enough permissions to create the ticket, tell an admin to give me "manage channels" permissions!]
  404. $c[This creates the ticket]
  405. $async[ticket1]
  406. $if[$getServerVar[ticketcategory]==]
  407. $createChannel[ticket-00$sum[$getServerVar[tickets];1];text]
  408. $else
  409. $createChannel[ticket-00$sum[$getServerVar[tickets];1];text;$getServerVar[ticketcategory]]
  410. $endif
  411. $endasync
  412.  
  413. $await[ticket1]
  414.  
  415. $if[$getServerVar[ticketcategory]==]
  416. $modifyChannel[$channelID[ticket-00$sum[$getServerVar[tickets];1]];!unchanged;Ticket opened by "$username[$authorID]#$discriminator[$authorID]";no;!unchanged]
  417. $else
  418. $modifyChannel[$channelID[ticket-00$sum[$getServerVar[tickets];1]];!unchanged;Ticket opened by "$username[$authorID]#$discriminator[$authorID]";no;!unchanged;$getServerVar[ticketcategory]]
  419. $endif
  420.  
  421. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];-readmessages;$guildID] $c[This deny the permission to view the ticket to everyone]
  422. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];+readmessages;$authorID] $c[This allows the permission to view the ticket to the user that creates the ticket]
  423. $if[$roleExists[$getServerVar[ticketstaff]]==true] $c[This checks if the staff role has been set... and if it exists then...]
  424. $modifyChannelPerms[$channelID[ticket-00$sum[$getServerVar[tickets];1]];+readmessages;$getServerVar[ticketstaff]] $c[This allows the permission to view the ticket to the staff role]
  425. $endif
  426.  
  427. $setUserVar[userticket;$channelID[ticket-00$sum[$getServerVar[tickets];1]]]
  428. $sendEmbedMessage[$channelID[ticket-00$sum[$getServerVar[tickets];1]];<@$authorID>;;;Hey **$username[$authorID]#$discriminator[$authorID]**, this is your ticket!
  429.  
  430. Please, state down below your whole problem,
  431. provide any detail you can so the staff can help you faster.
  432. Our staff team will answer soon as possible!
  433.  
  434. Please run $var[prefix]close when your problem has been solved
  435. or use the "close" red button below.
  436.  
  437. Be patient till a staff check your ticket!
  438.  
  439. 🔒 **Close**
  440. You or the staff can use "$var[prefix]close" to close the ticket
  441. 💻 **Panel**
  442. The staff can open the ticket panel with "$var[prefix]panel";$var[color];New ticket!;;$username[$botID] ticket system;;https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png;;yes;no]
  443.  
  444.  
  445.  
  446. $setServerVar[tickets;$sum[$getServerVar[tickets];1]]
  447. $endif
  448.  
  449. $suppressErrors[Hey, you just discovered a bug...
  450. For the Bot Developer:
  451. - To know the exact error message just remove this line of code (suppress errors) and execute the stuff again.
  452. For the Users using the bot:
  453. - Hey, just let the bot owner know about this issue if you have some way to contact them :)]
  454.  
  455. $c[a command of Berk#3506 for the channel "Bot Designer For Discord: Guide"]
  456. $c[If you're going to share the code for the public, don't remove/edit the comment above]
  457. $c[Get more exclusive codes at https://dsc.gg/codes]
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. ===================================== THIRD CODE, THE TRIGGER MUST BE YOUR BOT PREFIX ONLY, NOTHING MORE, JUST YOUR BOT PREFIX, AS EXAMPLE "+" AND ENABLE BDSCRIPT 2 MODE, THIS IS A MEDIUM-LONG CODE, BUT IGNORE THE 2K CHARACTERS WARNING!:
  466.  
  467.  
  468.  
  469.  
  470.  
  471. $c[THE TRIGGER OF THIS COMMAND SHOULD BE **ONLY** YOUR BOT PREFIX, NOTHING MORE!]
  472. $c[ENABLE BDSCRIPT 2 MODE]
  473. $c[You can keep the normal BDscript mode on this command]
  474. $c[This code works as a "+enable-tickets", "+disable-tickets" command, "+set-ticket-category", "+remove-ticket-category" command, a "+remove-staff-role" command and as a "+set-staff-role <role>" command at same time]
  475. $c[You only can set ONE staff role]
  476.  
  477. $c[Checkers: variables]
  478. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  479. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  480. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  481. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  482. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  483.  
  484. $c[ EDITABLE SETTINGS ]
  485.  
  486. $var[prefix;+] $c[YOUR BOT PREFIX, IN THIS CASE I USED "+" AS EXAMPLE]
  487. $var[color;ed3491] $c[ANY HEXCODE COLOUR, I USED "#ed3491" AS EXAMPLE]
  488.  
  489. $c[ EDITABLE SETTINGS ]
  490.  
  491. $nomention
  492. $if[%$toLowercase[$message[1]]%==%set-staff-role%]
  493. $author[Ticket Staff Set]
  494. $description[The Tickets Staff role has been set! now the role <@&$findRole[$replaceText[$message;$message[1];;1]]> has access to view tickets! to disable this, just do $var[prefix]remove-staff-role]
  495. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  496. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  497. $color[$var[color]]
  498. $setServerVar[ticketstaff;$findRole[$replaceText[$message;$message[1];;1]]]
  499. $addTimestamp
  500. $onlyIf[$roleExists[$findRole[$replaceText[$message;$message[1];;1]]]==true;Hey, it looks like i can't find that role, please try using a valid role Mention/ID/Name!]
  501. $onlyIf[$message[2]!=;Please type a role ID/mention or name to set as ticket staff role!]
  502. $onlyPerms[managechannels;Hey, you need manage channels permissions to do this!]
  503. $endif
  504.  
  505. $if[%$toLowercase[$message[1]]%==%remove-staff-role%]
  506. $author[Ticket Staff Set]
  507. $description[The Tickets Staff role has been removed! you can set a Ticket Staff role with $var[prefix]set-staff-role :)]
  508. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  509. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  510. $color[$var[color]]
  511. $setServerVar[ticketstaff;]
  512. $addTimestamp
  513. $onlyPerms[managechannels;Hey, you need manage channels permissions to do this!]
  514. $endif
  515.  
  516. $if[%$toLowercase[$message[1]]%==%set-ticket-category%]
  517. $suppressErrors[Hey, please add a category ID to set as ticket category! if you don't know how, it's easy, just enable the developer mode in the settings, and then right click (or long tap if you're on mobile) to the category and click/tap "copy ID"]
  518. $author[Ticket Category Set]
  519. $description[The Tickets Category has been set! now i'll create the tickets on the <#$findChannel[$channelName[$message[2]]]> category! to disable this, just do $var[prefix]remove-ticket-category]
  520. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  521. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  522. $color[$var[color]]
  523. $setServerVar[ticketcategory;$findChannel[$channelName[$message[2]]]]
  524. $addTimestamp
  525. $onlyIf[$findChannel[$channelName[$message[2]]]!=;Please put a valid category ID of this server! if you don't know how, it's easy, just enable the developer mode in the settings, and then right click (or long tap if you're on mobile) to the category and click/tap "copy ID"]
  526. $onlyIf[$charCount[$message[2]]==18;Please put a valid **category ID**! if you don't know how, it's easy, just enable the developer mode in the settings, and then right click (or long tap if you're on mobile) to the category and click/tap "copy ID"]
  527. $onlyIf[$isNumber[$message[2]]==true;Please put a valid **category ID**! if you don't know how, it's easy, just enable the developer mode in the settings, and then right click (or long tap if you're on mobile) to the category and click/tap "copy ID"]
  528. $onlyPerms[managechannels;Hey, you need manage channels permissions to do this!]
  529. $endif
  530.  
  531. $if[%$toLowercase[$message[1]]%==%remove-ticket-category%]
  532. $author[Ticket Category Removed]
  533. $description[The Tickets Category has been removed! now i'll create the tickets outside any category! to enable a category, just do $var[prefix]set-ticket-category <category ID>]
  534. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  535. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  536. $color[$var[color]]
  537. $setServerVar[ticketcategory;]
  538. $addTimestamp
  539. $onlyPerms[managechannels;Hey, you need manage channels permissions to do this!]
  540. $suppressErrors
  541. $endif
  542.  
  543. $if[%$toLowercase[$message[1]]%==%enable-tickets%]
  544. $author[Ticket System Enabled]
  545. $description[The Tickets on this server are now enabled! people can create tickets with "$var[prefix]ticket", if you want to disable the system just do $var[prefix]disable-tickets
  546. **Things you can do with this ticket system:**
  547. $var[prefix]set-staff-role <@role> - to set a role as staff role for tickets
  548. $var[prefix]remove-staff-role - to remove the staff role
  549. $var[prefix]set-ticket-category <category ID> - to set a category where the tickets will be created
  550. $var[prefix]remove-ticket-category - to remove the ticket category
  551. ]
  552. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  553. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  554. $color[$var[color]]
  555. $setServerVar[ticketsystem;yes]
  556. $addTimestamp
  557. $endif
  558.  
  559. $if[%$toLowercase[$message[1]]%==%disable-tickets%]
  560. $author[Ticket System Disabled]
  561. $description[The Tickets on this server are now disabled! people can't create tickets with "$var[prefix]ticket" anymore, if you want to enable the system just do $var[prefix]enable-tickets
  562. **Things you can do with this ticket system:**
  563. $var[prefix]set-staff-role <@role> - to set a role as staff role for tickets
  564. $var[prefix]remove-staff-role - to remove the staff role
  565. $var[prefix]set-ticket-category <category ID> - to set a category where the tickets will be created
  566. $var[prefix]remove-ticket-category - to remove the ticket category
  567. ]
  568. $footer[$username[$botID] ticket system | executed by $username[$authorID]#$discriminator[$authorID]]
  569. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  570. $color[$var[color]]
  571. $setServerVar[ticketsystem;no]
  572. $addTimestamp
  573. $endif
  574.  
  575. $c[a command of Berk#3506 for the channel "Bot Designer For Discord: Guide"]
  576. $c[If you're going to share the code for the public, don't remove/edit the comment above]
  577. $c[Get more exclusive codes at https://dsc.gg/codes]
  578. $suppressErrors
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587. ===================================== FOURTH CODE, THE TRIGGER MUST BE "(prefix)setup-ticket" AND ENABLE BDSCRIPT 2 MODE, THIS ONE ISN'T THAT LONG!:
  588.  
  589.  
  590.  
  591.  
  592.  
  593. $nomention
  594. $c[Checkers: variables]
  595. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  596. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  597. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  598. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  599. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  600.  
  601. $c[all the embed below is editable, edit it how you want :)]
  602. $color[ed3491]
  603. $description[Click the button to open a ticket!]
  604. $footer[$username[$botID] ticket system]
  605. $addButton[no;openticket;Click to open;primary;no;✉]
  606. $onlyPerms[managechannels;**$username** Hey! you need manage channels permissions to setup a ticket channel button!]
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616. ===================================== FIFTH CODE, THE TRIGGER MUST BE "(prefix)close" AND ENABLE BDSCRIPT 2 MODE, IGNORE THE 2K CHARACTER LIMIT!:
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623. $nomention
  624.  
  625. $c[Checkers: variables]
  626. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  627. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  628. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  629. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  630. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  631.  
  632. $c[ EDITABLE SETTINGS ]
  633.  
  634. $var[color;ed3491] $c[ANY HEXCODE COLOUR, I USED "#ed3491" AS EXAMPLE]
  635.  
  636. $c[ EDITABLE SETTINGS ]
  637.  
  638. $addButton[no;justclose;Just close;danger;no;🔐]
  639. $if[$checkContains[$channelTopic;Closed & Saved]==false]
  640. $addButton[no;closeandsave;Close & Save;primary;no;💾]
  641. $else
  642. $addButton[no;closeandsave;Closed & Saved;primary;yes;💾]
  643. $addButton[no;openagain;Open Ticket;success;no;🔑]
  644. $endif
  645.  
  646. $author[Are you sure? pick an option]
  647. $description[
  648. Hey **$username[$authorID]#$discriminator[$authorID]** do you really want to close the ticket?
  649.  
  650. 🔐 **Just close**
  651. Just close the ticket, without saving any content inside it, this action can't be undone.
  652. 💾 **Close & Save** - staff only
  653. Close the ticket, but save the channel, it removes the user permissions to view the ticket.
  654. ]
  655. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  656. $color[$var[color]]
  657. $footer[$username[$botID] ticket system]
  658. $onlyIf[$checkContains[$channelName[$channelID];ticket-00]==true;Sorry, this isn't a valid ticket.]
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669. ===================================== SIXTH AND LAST CODE, THE TRIGGER MUST BE "(prefix)panel" AND ENABLE BDSCRIPT 2 MODE, IGNORE THE 2K CHARACTER LIMIT!:
  670.  
  671.  
  672.  
  673.  
  674.  
  675. $nomention
  676.  
  677. $c[Checkers: variables]
  678. $varExistError[ticketsystem;Please create the variable "ticketsystem" in the app, with value "no", of course without quote symbols]
  679. $varExistError[tickets;Please create the variable "tickets" in the app, with value "0", of course without quote symbols]
  680. $varExistError[ticketcategory;Please create the variable "ticketcategory" in the app, without any value]
  681. $varExistError[ticketstaff;Please create the variable "ticketstaff" in the app, without any value]
  682. $varExistError[userticket;Please create the variable "userticket" in the app, without any value]
  683.  
  684. $c[ EDITABLE SETTINGS ]
  685.  
  686. $var[color;ed3491] $c[ANY HEXCODE COLOUR, I USED "#ed3491" AS EXAMPLE]
  687.  
  688. $c[ EDITABLE SETTINGS ]
  689.  
  690. $author[Ticket Panel]
  691. $color[$var[color]]
  692. $thumbnail[https://cdn.discordapp.com/attachments/899671061933740042/899676586691923988/52722-ticket.png]
  693. $description[
  694. Hey **$username[$authorID]#$discriminator[$authorID]**, please pick an option down below!
  695.  
  696. 🔒 **Close** - user & staff
  697. You can use this button to close the ticket.
  698.  
  699. ✋ **Claim** - staff only
  700. You can use this button to claim the ticket.
  701. Who claims the ticket will be the only one able to close it.
  702. ]
  703. $footer[$username[$botID] ticket system]
  704. $addTimestamp
  705. $c[This adds the buttons]
  706. $addButton[no;closeticket;Close;danger;no;🔒]
  707. $addButton[no;claimticket;Claim;secondary;no;✋]
  708. $onlyIf[$checkContains[$channelName[$channelID];ticket-00]==true;Sorry, this isn't a valid ticket.]
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715. ====================================================================================================
  716. THAT'S ALL, DON'T FORGET TO SUBSCRIBE FOR MORE FREE ADVANCED CODES
  717. - https://dsc.gg/codes
Advertisement
Add Comment
Please, Sign In to add comment