Advertisement
BDFD_Berk

[5/5] last $onInteraction | Ticket System BDFD

Jan 3rd, 2023
765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $nomention
  2. $suppressErrors
  3. $c[ ... system configuration, read the comments. ]
  4. $c[ ... button emojis, "true" to keep them enabled, "false" to disable them. ]
  5. $var[emojis;true]
  6.  
  7. $c[ ... Below you can change button emojis to any desired emojis from your keyboard, such as 🔒. Do not use Discord emoji names like :lock: ]
  8.  
  9. $if[$var[emojis]==true]
  10. $var[solved_emoji;💾]
  11. $var[close_emoji;🔒]
  12. $var[open_emoji;🔓]
  13. $var[sticky_emoji;🗃️]
  14. $var[claim_emoji;🙋‍♂️]
  15. $var[info_emoji;🪪]
  16. $var[back_to_panel_emoji;◀️]
  17. $var[panel_emoji;🛠️]
  18. $var[openticket_emoji;🎫]
  19. $endif
  20.  
  21. $c[ ... general configuration ]
  22. $c[
  23. if you want to know what each setting below do then check this table, do not change these settings without reading first, or it may lead to errors.
  24. https://i.imgur.com/2qEwMVN.png
  25. ]
  26. $var[newticket_ping;true]
  27. $var[branding;true]
  28. $var[hide_on_sticky;true]
  29. $var[webhook;true]
  30. $var[webhook_default_subject;Hey {user}, how can we help you today?]
  31. $var[always_guild;false]
  32. $var[rating;true]
  33. $var[panel_limit;7] $c[number from scale 1-7]
  34. $var[default_image;https://i.imgur.com/AZlgvgi.png] $c[ <== max. 37 characters URL ]
  35. $c[ ... Make sure the hexcode colors you provide are valid to avoid errors. ]
  36. $var[main_color;#1874cb]
  37. $var[neutral_color;#faa81a]
  38. $var[success_color;#08b278]
  39. $var[error_color;#ea003a]
  40.  
  41. $var[rt_msg;To help **{server}** improve their support ticket experience we would like to receive your anonymous feedback.]
  42. $var[rt_footer;How would you rate the support received?]
  43. $var[negative_rate;Sorry to hear that! Thank you for **rating** this server's ticket support experience, your feedback **helps** ``{server}`` **improve** your support experience, we truly **appreciate** your honesty.]
  44. $var[positive_rate;Glad to hear that! Thank you for **rating** this server's ticket support experience, your feedback **helps** ``{server}`` **improve** your support experience, we truly **appreciate** your feedback.]
  45.  
  46. $c[ ... Error message that appears when a user don't have enough permissions to use a button. ]
  47. $var[sf_title;Staff only!]
  48. $var[sf_descr;Sorry, only staff members with special permissions are allowed to do this, you can contact a staff member to do it for you.]
  49.  
  50. $c[ Close ticket button timer, maximal value is 2400 seconds, I just recommend to not touch, time must be in seconds only. ]
  51. $var[close_in;120]
  52.  
  53. $c[
  54. ... Unless you understand the entire system, do not edit the code infrastructure below. You can translate it, but make sure not to remove or edit the name of any function.
  55. ]
  56.  
  57. $var[ticket_message_default;
  58. Hello **{username}**, this is your ticket!
  59. Please, write down below details about your problem. Support will be with you shortly!
  60.  
  61. You are allowed to ping a support member once after 30 minutes of no response, avoid mass-pinging!
  62.  
  63. You can close this ticket at anytime by using the **close** button.
  64. Staff can manage this ticket by using the **panel** button.
  65. ]
  66.  
  67. $if[$checkContains[$message;tkt_mdl_o-]==true]
  68. $stop
  69. $endif
  70. $if[$checkContains[$customID;tkt_mdl_op-]==true]
  71. $stop
  72. $endif
  73.  
  74. $if[$checkContains[$customID;tkt]==true]
  75. $if[$checkContains[$customID;mdl]==false]
  76. $defer
  77. $endif
  78. $endif
  79. $if[$getUserVar[tickets2;$botID]!=]
  80. $textSplit[$getUserVar[tickets2;$botID];-]
  81. $if[$serverChannelExists[$splitText[1]]==true] $var[category;$splitText[1]] $endif
  82. $if[$serverChannelExists[$splitText[2]]==true] $var[logs;$splitText[2]] $endif
  83. $if[$isNumber[$splitText[3]]==true] $var[close_in;$splitText[3]] $endif
  84. $if[$isBoolean[$splitText[4]]==true] $var[rating;$splitText[4]] $endif
  85. $if[$isBoolean[$splitText[5]]==true] $var[webhook;$splitText[5]] $endif
  86. $endif
  87. $textSplit[$getUserVar[tickets3;$botID];≈]
  88. $if[$splitText[1]==] $var[ticket_title;New Ticket!] $else $var[ticket_title;$splitText[1]] $endif
  89. $if[$splitText[2]==]
  90. $var[ticket_message;$var[ticket_message_default]]
  91. $else
  92. $var[ticket_message;$splitText[2]]
  93. $endif
  94. $if[$isValidHex[$splitText[3]]==false]
  95. $var[color;$var[main_color]]
  96. $else
  97. $var[color;$splitText[3]]
  98. $endif
  99. $if[$checkContains[$splitText[4];.png;.jpg;.jpeg;.gif;.webp]==false]
  100. $var[s_image;https://i.imgur.com/YxlQphp.png]
  101. $else
  102. $var[s_image;$splitText[4]]
  103. $endif
  104. $if[$var[branding]==true]
  105. $var[s_thumbnail;https://i.imgur.com/IlZ2w9w.png]
  106. $endif
  107. $textSplit[$getServerVar[tickets3];-]
  108. $var[ts1;$splitText[1]]
  109. $var[ts2;$splitText[2]]
  110. $textSplit[$var[ts1];,]
  111. $try $var[has_staff;$hasRole[$authorID;$splitText[1]]] $endtry
  112. $if[$var[has_staff]!=true]
  113. $try $var[has_staff;$hasRole[$authorID;$splitText[2]]] $endtry
  114. $endif
  115. $if[$var[has_staff]!=true]
  116. $try $var[has_staff;$hasRole[$authorID;$splitText[3]]] $endtry
  117. $endif
  118. $textSplit[$var[ts2];,]
  119. $try $var[is_blacklisted;$hasRole[$authorID;$splitText[1]]] $var[black_role;<@&$splitText[1]>] $endtry
  120. $if[$var[is_blacklisted]!=true]
  121. $try $var[is_blacklisted;$hasRole[$authorID;$splitText[2]]] $var[black_role;<@&$splitText[2]>] $endtry
  122. $endif
  123. $if[$var[is_blacklisted]!=true]
  124. $try $var[is_blacklisted;$hasRole[$authorID;$splitText[3]]] $var[black_role;<@&$splitText[3]>] $endtry
  125. $endif
  126. $if[$var[rating]!=true]
  127. $var[rt_msg;]
  128. $var[rt_footer;]
  129. $endif
  130. $if[$var[has_staff]!=true]
  131. $if[$or[$checkUserPerms[$authorID;ban]==true;$checkUserPerms[$authorID;kick]==true;$checkUserPerms[$authorID;managemessages]==true;$checkUserPerms[$authorID;moderatemembers]==true;$checkUserPerms[$authorID;admin]==true]==true]
  132. $var[is_staff;true]
  133. $else
  134. $var[is_staff;false]
  135. $endif
  136. $else
  137. $var[is_staff;true]
  138. $endif
  139. $if[$checkContains[$customID;tkt_actop-]==true]
  140. $removeButtons
  141. $defer
  142. $if[$var[is_blacklisted]==true]
  143. $title[You can't create tickets!]
  144. $description[Hi **$username[$authorID]**! Unfortunately, one of your roles ($var[black_role]) has been restricted from creating new tickets. If you believe this is a mistake, contact a server manager to have the role removed from the ticket setup command.]
  145. $color[$var[error_color]]
  146. $ephemeral
  147. $stop
  148. $endif
  149. $textSplit[$customID;-]
  150. $var[index;$splitText[2]]
  151. $var[subject;$input[subject]]
  152. $if[$charCount[$replaceText[$var[index];0;;1]]>1]
  153. $var[topic_msg;
  154. **Ticket Panel**
  155. ```$cropText[$var[index];$sub[$charCount[$var[index]];2];]```]
  156. $endif
  157. $if[$optOff[$serverChannelExists[$getUserVar[tickets2;$authorID]]]==true]
  158. $if[$checkContains[$channelName[$getUserVar[tickets2]];solved-]==false]
  159. $description[**$username[$authorID]** You already have an open ticket! Please move to your active ticket <#$getUserVar[tickets2]> instead.]
  160. $color[$var[error_color]]
  161. $ephemeral
  162. $stop
  163. $endif
  164. $endif
  165. $var[subject;$cropText[$var[subject];400;(...)]]
  166. $if[$var[subject]==]
  167. $var[subject;No subject was provided by the user.]
  168. $var[subject_empty;true]
  169. $else
  170. $var[subject_empty;false]
  171. $endif
  172. $var[channel_description;Ticket opened by **$username[$authorID]#$discriminator[$authorID]** <t:$getTimestamp:R> (<t:$getTimestamp:F>)]
  173. $var[ticket_message;$replaceText[$var[ticket_message];{username};$username[$authorID];-1]]
  174. $var[format;ticket-{number}]
  175. $if[$isNumber[$getServerVar[tickets]]==false]
  176. $setServerVar[tickets;0]
  177. $endif
  178. $var[tickets;$sum[$getServerVar[tickets];1]]
  179. $if[$charCount[$var[tickets]]==1]
  180. $var[num;000$var[tickets]]
  181. $endif
  182. $if[$charCount[$var[tickets]]==2]
  183. $var[num;00$var[tickets]]
  184. $endif
  185. $if[$charCount[$var[tickets]]==3]
  186. $var[num;0$var[tickets]]
  187. $endif
  188. $if[$charCount[$var[tickets]]>3]
  189. $var[num;$var[tickets]]
  190. $endif
  191. $var[username_format;$replaceText[$replaceText[$url[encode;$cropText[$username[$authorID];7;]];-;;-1];%;;-1]]
  192. $var[name;$replaceText[$replaceText[$replaceText[$replaceText[$var[format];{number};$var[num];1];{username};$var[username_format];1];{random_number};$random[10000;99999];-1];{discriminator};$discriminator[$authorID];-1]]
  193. $if[$charCount[$var[category]]>14]
  194. $createChannel[$var[name];text;$var[category]]
  195. $else
  196. $createChannel[$var[name];text]
  197. $endif
  198. $setServerVar[tickets;$sum[$getServerVar[tickets];1]]
  199. $var[new_ticket;$findChannel[$var[name]]]
  200. $var[success_open;<@$authorID> You successfully opened the ticket <#$var[new_ticket]>!]
  201. $description[$var[success_open]]
  202. $color[$var[success_color]]
  203. $ephemeral
  204. $setChannelVar[tickets;$authorID;$var[new_ticket]]
  205. $setUserVar[tickets2;$var[new_ticket]]
  206. $modifyChannel[$var[new_ticket];!unchanged;$var[channel_description];false;!unchanged;!unchanged]
  207. $textSplit[$getServerVar[tickets3];-]
  208. $var[ts1;$splitText[1]]
  209. $var[ts2;$splitText[2]]
  210. $textSplit[$var[ts1];,]
  211. $if[$roleExists[$splitText[1]]==true] $try $editChannelPerms[$var[new_ticket];$splitText[1];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  212. $if[$roleExists[$splitText[2]]==true] $try $editChannelPerms[$var[new_ticket];$splitText[2];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  213. $if[$roleExists[$splitText[3]]==true] $try $editChannelPerms[$var[new_ticket];$splitText[3];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  214. $editChannelPerms[$var[new_ticket];$guildID;-readmessages]
  215. $editChannelPerms[$var[new_ticket];$authorID;+sendmessages;+readmessages;+embedlinks;+attachfiles]
  216. $useChannel[$var[new_ticket]]
  217. $try
  218. $if[$var[newticket_ping]==true]
  219. $var[ping_id;$sendMessage[<@$authorID>;yes]]
  220. $deleteMessage[$var[new_ticket];$var[ping_id]]
  221. $endif
  222. $endtry
  223. $if[$isValidHex[$var[color]]==false]
  224. $var[color;$var[main_color]]
  225. $endif
  226. $async[logs_block]
  227. $if[$serverChannelExists[$var[logs]]]
  228. $try
  229. $sendEmbedMessage[$var[logs];;New Ticked Created!;;Ticket ``#$channelName[$var[new_ticket]]`` (<#$var[new_ticket]>) has been **created** by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  230. **Subject**
  231. ```$var[subject]```
  232. ;$var[main_color];;;;;;;;no]
  233. $endtry
  234. $endif
  235. $endasync
  236. $var[res_id;$sendEmbedMessage[$var[new_ticket];
  237. ;$var[ticket_title]
  238. ;$getBotInvite
  239. ;$var[ticket_message]$var[topic_msg]
  240. **Ticket Subject**
  241. ```$var[subject]```
  242. ;$var[color]
  243. ;$username[$authorID]#$discriminator[$authorID]
  244. ;$userAvatar[$authorID];;;$var[s_thumbnail]
  245. ;$var[s_image]
  246. ;no
  247. ;yes]]
  248. $addButton[no;tkt_close;Close Ticket;danger;no;$var[close_emoji];$var[res_id]]
  249. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji];$var[res_id]]
  250. $if[$var[webhook]==true]
  251. $try
  252. $if[$and[$var[subject_empty]==false;$var[always_guild]==false]==true]
  253. $var[webhookURL;$webhookCreate[$var[new_ticket];$username[$authorID];$userAvatar[$authorID]]]
  254. $webhookAvatarURL[$var[webhookURL];$userAvatar[$authorID]]
  255. $webhookContent[$var[webhookURL];$var[subject]]
  256. $else
  257. $var[webhookURL;$webhookCreate[$var[new_ticket];$serverName[$guildID];$serverIcon[$guildID]]]
  258. $webhookAvatarURL[$var[webhookURL];$serverIcon[$guildID]]
  259. $webhookContent[$var[webhookURL];$replaceText[$var[webhook_default_subject];{user};<@$authorID>;-1]]
  260. $endif
  261. $endtry
  262. $endif
  263. $stop $c[s]
  264. $endif
  265. $if[$customID==tkt_mdl_emd]
  266. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  267. $removeButtons
  268. $title[$var[sf_title]]
  269. $description[$var[sf_descr]]
  270. $color[$var[error_color]]
  271. $ephemeral
  272. $stop
  273. $endif
  274. $textSplit[$getUserVar[tickets3;$botID];≈]
  275. $if[$splitText[1]==] $var[e_title;New Ticket!] $else $var[e_title;$splitText[1]] $endif
  276. $if[$splitText[2]==] $var[e_desc;$var[ticket_message]] $else $var[e_desc;$splitText[2]] $endif
  277. $if[$splitText[3]==] $var[e_color;$var[main_color]] $else $var[e_color;$splitText[3]] $endif
  278. $if[$splitText[4]==] $var[e_image;$var[s_image]] $else $var[e_image;$splitText[4]] $endif
  279. $newModal[tkt_emdset;Embed Settings]
  280. $addTextInput[embed_title;short;Embed Title;1;50;no;$var[e_title];Embed title, leave it empty to use the default one.]
  281. $addTextInput[embed_description;paragraph;Embed Description;1;500;no;$var[e_desc];Embed description, leave it empty to use the default one, you can use the {username} placeholder.]
  282. $addTextInput[embed_color;short;Embed Color;6;7;no;$var[e_color];Embed color hexcode, leave it empty to use the default one.]
  283. $addTextInput[embed_image;short;Embed Bottom Image URL;5;100;no;$var[e_image];Embed bottom image URL, leave it empty to use the default one.]
  284. $endif
  285. $if[$customID==tkt_emdset]
  286. $var[pf;0]
  287. $if[$input[embed_color]!=]
  288. $if[$isValidHex[$input[embed_color]]==false]
  289. $var[problems;$var[problems] The embed color hexcode you gave is not valid or I can't recognize it as valid, try using a Hexcode Color Picker online. ]
  290. $var[pf;$sum[$var[pf];1]]
  291. $endif
  292. $endif
  293. $if[$input[embed_image]!=]
  294. $if[$checkContains[$input[embed_image];.png;.jpg;.webp;.gif;.jpeg]==false]
  295. $var[problems;$var[problems] The embed image URL you gave is not valid or I can't recognize it as valid, valid image URLs ends with the image extension such as .jpg, .png, and so on, you can try to upload the image to Discord, copying the link and using it. ]
  296. $var[pf;$sum[$var[pf];1]]
  297. $endif
  298. $endif
  299. > :ballot_box_with_check: *This is a preview, you can dismiss it, **$var[pf]** problems found, **changes saved successfully**.*
  300. $if[$var[pf]>0]
  301. $var[ind;2]
  302. $author[Problems Found;1]
  303. $description[```$replaceText[$replaceText[$var[problems]; ;;1]; ; & ;-1]```;1]
  304. $color[$var[error_color];1]
  305. $else
  306. $var[ind;1]
  307. $endif
  308. $if[$input[embed_title]!=]
  309. $title[$input[embed_title];$var[ind]]
  310. $else
  311. $title[New Ticket!;$var[ind]]
  312. $endif
  313. $embeddedURL[$getBotInvite;$var[ind]]
  314. $if[$input[embed_description]!=]
  315. $description[$replaceText[$input[embed_description];{username};$username[$authorID];-1];$var[ind]]
  316. $else
  317. $description[$replaceText[$var[ticket_message_default];{username};$username[$authorID];-1];$var[ind]]
  318. $endif
  319. $addField[Ticket Panel;```Panel Name would go here.```;no;$var[ind]]
  320. $addField[Ticket Subject;```Ticket Subject would go here.```;no;$var[ind]]
  321. $try $thumbnail[$var[s_thumbnail];$var[ind]] $endtry
  322. $if[$input[embed_image]!=]
  323. $try $image[$input[embed_image];$var[ind]] $catch $try $image[$var[s_image];$var[ind]] $endtry $endtry
  324. $else
  325. $try $image[$var[s_image];$var[ind]] $endtry
  326. $endif
  327. $if[$input[embed_color]!=]
  328. $try $color[$input[embed_color];$var[ind]] $catch $try $color[$var[main_color];$var[ind]] $endtry $endtry
  329. $else
  330. $try $color[$var[main_color];$var[ind]] $endtry
  331. $endif
  332. $try
  333. $setUserVar[tickets3;$replaceText[$input[embed_title];≈;~;-1]≈$replaceText[$input[embed_description];≈;~;-1]≈$replaceText[$input[embed_color];≈;~;-1]≈$replaceText[$input[embed_image];≈;~;-1];$botID]
  334. $catch
  335. > :x: *There has been an error trying to save the embed data correctly, please contact a Developer.*
  336. $endtry
  337. $ephemeral
  338. $stop $c[s]
  339. $endif
  340. $if[$customID==tkt_mdl_gnrl]
  341. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  342. $removeButtons
  343. $title[$var[sf_title]]
  344. $description[$var[sf_descr]]
  345. $color[$var[error_color]]
  346. $ephemeral
  347. $stop
  348. $endif
  349. $textSplit[$getUserVar[tickets2;$botID];-]
  350. $if[$splitText[3]==] $var[split3;$var[close_in]] $else $var[split3;$splitText[3]] $endif
  351. $if[$splitText[4]==] $var[split4;$var[rating]] $else $var[split4;$splitText[4]] $endif
  352. $if[$splitText[5]==] $var[split5;$var[webhook]] $else $var[split5;$splitText[5]] $endif
  353. $newModal[tkt_gnrlset;General Settings]
  354. $addTextInput[category;short;New Tickets Category;1;50;no;$splitText[1];Category ID or name, where tickets will be created.]
  355. $addTextInput[logschannel;short;Ticket Logs Channel;1;50;no;$splitText[2];Channel ID or name, where I will log closed/opened tickets.]
  356. $addTextInput[closein;short;Close Button Time (in seconds);1;5;no;$var[split3]s;There's a timer in the Close Ticket button, value in SECONDS for that timer.]
  357. $addTextInput[rating;short;Should Rating be enabled?;2;5;no;$var[split4];Yes/no or true/false, should the users be able to rate?]
  358. $addTextInput[webhooks;short;Should Webhooks be enabled?;2;5;no;$var[split5];Yes/no or true/false, should I send a webhook message in new tickets?]
  359. $endif
  360. $if[$customID==tkt_mdl_rls]
  361. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  362. $removeButtons
  363. $title[$var[sf_title]]
  364. $description[$var[sf_descr]]
  365. $color[$var[error_color]]
  366. $ephemeral
  367. $stop
  368. $endif
  369. $textSplit[$getServerVar[tickets3];-]
  370. $var[current_sr;$splitText[1]]
  371. $var[current_br;$splitText[2]]
  372. $newModal[tkt_rlsset;Role Settings]
  373. $addTextInput[staffroles;short;Staff Role(s) (Max 3 roles);1;55;no;$var[current_sr];Role(s) name, ID or mention, separable using commas.]
  374. $addTextInput[blacklistedroles;short;Blacklisted Role(s) (Max 3 roles);1;55;no;$var[current_br];Role(s) name, ID or mention, separable using commas.]
  375. $endif
  376. $if[$customID==tkt_mdl_cfg-$authorID]
  377. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  378. $stop
  379. $endif
  380. $newModal[tkt_cfg-$authorID;Embed Customization]
  381. $addTextInput[ticket-title;short;Embed Title;1;40;yes;;Any Title you want to show in the embed here, required.]
  382. $addTextInput[ticket-description;paragraph;Embed Description;1;300;yes;;Any Description you want to show in the embed here, required.]
  383. $addTextInput[ticket-footer;short;Embed Footer;0;50;no;;Any Footer you want to show in the embed here, optional.]
  384. $addTextInput[ticket-color;short;Embed Color Hexcode;6;7;no;;Any color hexcode (e.x "ffffff") or leave it empty, optional.]
  385. $addTextInput[ticket-image;short;Embed Image URL;1;32;no;$var[default_image];Any image URL or leave it empty to use default one, optional.]
  386. $endif
  387. $if[$customID==tkt_pnlact_mdl_add-$authorID]
  388. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  389. $removeButtons
  390. $title[$var[sf_title]]
  391. $description[$var[sf_descr]]
  392. $color[$var[error_color]]
  393. $ephemeral
  394. $stop
  395. $endif
  396. $textSplit[$getChannelVar[tickets];≈]
  397. $var[l;$getTextSplitLength]
  398. $if[$var[l]>$var[panel_limit]]
  399. $removeButtons
  400. $description[You cannot create another Ticket Panel, there's a limit of **$var[panel_limit]** panels! You can either remove a panel or create another ticket menu.]
  401. $color[$var[error_color]]
  402. $ephemeral
  403. $stop
  404. $endif
  405. $newModal[tkt_pnlact_add-$authorID;Create new panel]
  406. $addTextInput[paneltitle;short;Panel Title;1;20;yes;;Title here (ex. "General Support")]
  407. $addTextInput[paneldescription;short;Panel Description;1;40;yes;;Description here (ex. "Get general support")]
  408. $endif
  409. $if[$customID==tkt_pnlact_mdl_edit-$authorID]
  410. $removeButtons
  411. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  412. $removeButtons
  413. $title[$var[sf_title]]
  414. $description[$var[sf_descr]]
  415. $color[$var[error_color]]
  416. $ephemeral
  417. $stop
  418. $endif
  419. $newModal[tkt_pnlact_edit-$authorID;Edit an existing panel]
  420. $addTextInput[panelid;short;Panel ID;1;1;yes;;ID here (ex. "2")]
  421. $addTextInput[paneltitle;short;New Panel Title;1;20;no;;Leave it empty to use the old Title!]
  422. $addTextInput[paneldescription;short;New Panel Description;1;40;no;;Leave it empty to use the old Description!]
  423. $ephemeral
  424. $endif
  425. $if[$customID==tkt_gnrlset]
  426. $var[pf;0]
  427. $if[$input[logschannel]!=]
  428. $var[logs_channel;$findChannel[$input[logschannel]]]
  429. $endif
  430. $if[$input[category]!=]
  431. $var[ticket_category;$findChannel[$input[category]]]
  432. $endif
  433. $if[$and[$var[ticket_category]==;$input[category]!=]==true]
  434. $var[ticket_category;01000010011001010111001001101011]
  435. $endif
  436. $if[$and[$var[logs_channel]==;$input[logschannel]!=]==true]
  437. $var[logs_channel;07082004]
  438. $endif
  439. $var[close_in;$replaceText[$input[closein];s;;-1]]
  440. $if[$input[webhooks]!=]
  441. $if[$isBoolean[$input[webhooks]]==true]
  442. $if[$checkContains[$toLowercase[$input[webhooks]];true;yes]==true]
  443. $addField[Webhooks;```Enabled ($input[webhooks])```;yes]
  444. $var[input_webhooks;true]
  445. $else
  446. $addField[Webhooks;```Disabled ($input[webhooks])```;yes]
  447. $var[input_webhooks;false]
  448. $endif
  449. $else
  450. $var[problems;$var[problems] The value you gave for the "Webhooks" option is invalid, it must be yes/no, or true/false. ]
  451. $var[pf;$sum[$var[pf];1]]
  452. $endif
  453. $endif
  454. $if[$input[rating]!=]
  455. $if[$isBoolean[$input[rating]]==true]
  456. $if[$checkContains[$toLowercase[$input[rating]];true;yes]==true]
  457. $addField[Rating System;```Enabled ($input[rating])```;yes]
  458. $var[input_rating;true]
  459. $else
  460. $addField[Rating System;```Disabled ($input[rating])```;yes]
  461. $var[input_rating;false]
  462. $endif
  463. $else
  464. $var[problems;$var[problems] The value you gave for the "Rating" option is invalid, it must be yes/no, or true/false. ]
  465. $var[pf;$sum[$var[pf];1]]
  466. $endif
  467. $endif
  468. $if[$var[close_in]!=]
  469. $if[$isNumber[$var[close_in]]==true]
  470. $if[$var[close_in]>2400]
  471. $var[problems;$var[problems] The value you gave for the "Button Closing Time" must be a number between 5 and 2400, the maximum is 2400 seconds (40 minutes), you can't exceed it. ]
  472. $var[pf;$sum[$var[pf];1]]
  473. $else
  474. $if[$var[close_in]>4]
  475. $if[$var[close_in]>60]
  476. $var[humanized;$divide[$var[close_in];60] minutes]
  477. $else
  478. $var[humanized;$var[close_in] seconds]
  479. $endif
  480. $addField[Close Button Timer;```$var[humanized] ($var[close_in] seconds)```;yes]
  481. $var[input_closein;$var[close_in]]
  482. $else
  483. $var[problems;$var[problems] The value you gave for the "Button Closing Time" must be a number between 5 and 2400, the minimum is 5 seconds. ]
  484. $var[pf;$sum[$var[pf];1]]
  485. $endif
  486. $endif
  487. $else
  488. $var[problems;$var[problems] The value you gave for the "Button Closing Time" option was not a number, please make sure to provide a valid number in SECONDS to represent the button close timer, such as "120" for 2 minutes. ]
  489. $var[pf;$sum[$var[pf];1]]
  490. $endif
  491. $endif
  492. $if[$var[logs_channel]!=]
  493. $try
  494. $var[logstype;$channelType[$var[logs_channel]]]
  495. $endtry
  496. $if[$var[logstype]==text]
  497. $if[$serverChannelExists[$var[logs_channel]]==true]
  498. $addField[Ticket Logs Channel;<#$var[logs_channel]>;yes]
  499. $var[input_logs;$var[logs_channel]]
  500. $else
  501. $var[problems;$var[problems] Invalid Ticket Logs Channel name/ID given, it must be a channel from this server! ]
  502. $var[pf;$sum[$var[pf];1]]
  503. $endif
  504. $else
  505. $var[problems;$var[problems] Invalid Ticket Logs Channel name/ID given, if you used a name try with an ID and viceversa, make sure the ID is right! ]
  506. $var[pf;$sum[$var[pf];1]]
  507. $endif
  508. $endif
  509. $if[$var[ticket_category]!=]
  510. $try
  511. $var[cattype;$channelType[$var[ticket_category]]]
  512. $endtry
  513. $if[$var[cattype]==category]
  514. $if[$serverChannelExists[$var[ticket_category]]==true]
  515. $addField[Tickets Category;<#$var[ticket_category]>;yes]
  516. $var[input_category;$var[ticket_category]]
  517. $else
  518. $var[problems;$var[problems] Invalid Ticket Category name/ID given, it must be a category from this server! ]
  519. $var[pf;$sum[$var[pf];1]]
  520. $endif
  521. $else
  522. $var[problems;$var[problems] Invalid Ticket Category name/ID given, if you used a name try with an ID and viceversa, make sure the ID is right! ]
  523. $var[pf;$sum[$var[pf];1]]
  524. $endif
  525. $endif
  526. $color[$var[success_color]]
  527. $title[Success!]
  528. $description[> **$var[pf]** problems found! Changes has been applied successfully.]
  529. $setUserVar[tickets2;$var[input_category]-$var[input_logs]-$var[input_closein]-$var[input_rating]-$var[input_webhooks];$botID]
  530. $if[$var[pf]>0]
  531. $addField[Problems Found;```$replaceText[$replaceText[$var[problems]; ;;1]; ; & ;-1]```]
  532. $endif
  533. $ephemeral
  534. $stop $c[s]
  535. $endif
  536. $if[$customID==tkt_rlsset]
  537. $if[$input[staffroles]!=]
  538. $textSplit[$replaceText[$replaceText[$replaceText[$input[staffroles];<;;-1];>;;-1];@&;;-1];,]
  539. $if[$roleExists[$findRole[$splitText[1]]]==true]
  540. $var[sr;$findRole[$splitText[1]]]
  541. $var[sr1;$findRole[$splitText[1]]]
  542. $endif
  543. $if[$getTextSplitLength>1]
  544. $if[$roleExists[$findRole[$splitText[2]]]==true]
  545. $var[sr;$var[sr] $findRole[$splitText[2]]]
  546. $var[sr2;$findRole[$splitText[2]]]
  547. $endif
  548. $endif
  549. $if[$getTextSplitLength>2]
  550. $if[$roleExists[$findRole[$splitText[3]]]==true]
  551. $var[sr;$var[sr] $findRole[$splitText[3]]]
  552. $var[sr3;$findRole[$splitText[3]]]
  553. $endif
  554. $endif
  555. $if[$and[$roleExists[$var[sr1]]==false;$roleExists[$var[sr2]]==false;$roleExists[$var[sr3]]==false]==true]
  556. $var[failed;true]
  557. $var[failed_error;Invalid roles given in "Staff Roles"! Try using role IDs separated by comma instead.]
  558. $endif
  559. $var[sr;$replaceText[$var[sr]; ;;-1]]
  560. $var[sr;$replaceText[$var[sr]; ;;-1]]
  561. $var[sr;$replaceText[$var[sr]; ;,;-1]]
  562. $textSplit[$var[sr];,]
  563. $var[sr_n;0]
  564. $if[$roleExists[$splitText[1]]==true] $var[sr_n;$sum[$var[sr_n];1]] $endif
  565. $if[$roleExists[$splitText[2]]==true] $var[sr_n;$sum[$var[sr_n];1]] $endif
  566. $if[$roleExists[$splitText[3]]==true] $var[sr_n;$sum[$var[sr_n];1]] $endif
  567. $var[sr_length;$var[sr_n]]
  568. $if[$var[sr_length]>1]
  569. $var[sr_msg;<@&$splitText[1]>
  570. <@&$splitText[2]>]
  571. $var[sr_plural;s]
  572. $else
  573. $var[sr_msg;<@&$splitText[1]>]
  574. $endif
  575. $if[$var[sr_length]>2]
  576. $var[sr_msg;$var[sr_msg]
  577. <@&$splitText[3]>]
  578. $endif
  579. $if[$checkContains[$var[sr_msg];<@&>]==true]
  580. $var[failed;true]
  581. $var[failed_error;Please use only one role value (ID, name, or mention) when specifying roles. Combining multiple values may cause errors. If you are using only one role, try using its ID. If the problem persists, contact a bot developer, this error comes from the "Staff Roles" input.]
  582. $endif
  583. $endif
  584. $if[$input[blacklistedroles]!=]
  585. $textSplit[$replaceText[$replaceText[$replaceText[$input[blacklistedroles];<;;-1];>;;-1];@&;;-1];,]
  586. $if[$roleExists[$findRole[$splitText[1]]]==true]
  587. $var[br;$findRole[$splitText[1]]]
  588. $var[br1;$findRole[$splitText[1]]]
  589. $endif
  590. $if[$getTextSplitLength>1]
  591. $if[$roleExists[$findRole[$splitText[2]]]==true]
  592. $var[br;$var[br] $findRole[$splitText[2]]]
  593. $var[br2;$findRole[$splitText[2]]]
  594. $endif
  595. $endif
  596. $if[$getTextSplitLength>2]
  597. $if[$roleExists[$findRole[$splitText[3]]]==true]
  598. $var[br;$var[br] $findRole[$splitText[3]]]
  599. $var[br3;$findRole[$splitText[3]]]
  600. $endif
  601. $endif
  602. $if[$and[$roleExists[$var[br1]]==false;$roleExists[$var[br2]]==false;$roleExists[$var[br3]]==false]==true]
  603. $var[failed;true]
  604. $var[failed_error;Invalid roles given in "Blacklisted Roles"! Try using role IDs separated by comma instead.]
  605. $endif
  606. $var[br;$replaceText[$var[br]; ;;-1]]
  607. $var[br;$replaceText[$var[br]; ;;-1]]
  608. $var[br;$replaceText[$var[br]; ;,;-1]]
  609. $textSplit[$var[br];,]
  610. $var[br_n;0]
  611. $if[$roleExists[$splitText[1]]==true] $var[br_n;$sum[$var[br_n];1]] $endif
  612. $if[$roleExists[$splitText[2]]==true] $var[br_n;$sum[$var[br_n];1]] $endif
  613. $if[$roleExists[$splitText[3]]==true] $var[br_n;$sum[$var[br_n];1]] $endif
  614. $var[br_length;$var[br_n]]
  615. $if[$var[br_length]>1]
  616. $var[br_msg;<@&$splitText[1]>
  617. <@&$splitText[2]>]
  618. $var[br_plural;s]
  619. $else
  620. $var[br_msg;<@&$splitText[1]>]
  621. $endif
  622. $if[$var[br_length]>2]
  623. $var[br_msg;$var[br_msg]
  624. <@&$splitText[3]>]
  625. $endif
  626. $if[$checkContains[$var[br_msg];<@&>]==true]
  627. $var[failed;true]
  628. $var[failed_error;Please use only one role value (ID, name, or mention) when specifying roles. Combining multiple values may cause errors. If you are using only one role, try using its ID. If the problem persists, contact a bot developer, this error comes from the "Blacklisted Roles" input.]
  629. $endif
  630. $endif
  631. $if[$var[failed]==true]
  632. $color[$var[error_color]]
  633. $title[Failed!]
  634. $description[Sorry **$username**, this action failed because of the following error:
  635. ```$var[failed_error]```]
  636. $footer[If you think this is a bug report it to a Bot Developer!]
  637. $ephemeral
  638. $stop
  639. $endif
  640. $if[$var[sr_msg]==]
  641. $var[sr_msg;``Not given!``]
  642. $endif
  643. $if[$var[br_msg]==]
  644. $var[br_msg;``Not given!``]
  645. $endif
  646. $setServerVar[tickets3;$replaceText[$var[sr]-$var[br]; ;;-1]]
  647. $color[$var[success_color]]
  648. $title[Success!]
  649. $description[The previous values have been successfully updated to the new values!]
  650. $addField[Staff Role$var[sr_plural];$var[sr_msg];yes]
  651. $addField[Blacklisted Role$var[br_plural];$var[br_msg];yes]
  652. $ephemeral
  653. $stop $c[s]
  654. $endif
  655. $if[$customID==tkt_cfg-$authorID]
  656. $removeButtons
  657. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  658. $removeButtons
  659. $title[$var[sf_title]]
  660. $description[$var[sf_descr]]
  661. $color[$var[error_color]]
  662. $ephemeral
  663. $stop
  664. $endif
  665. $var[t_title;$input[ticket-title]]
  666. $var[t_desc;$input[ticket-description]]
  667. $var[t_footer;$input[ticket-footer]]
  668. $var[t_color;$input[ticket-color]]
  669. $var[t_image;$input[ticket-image]]
  670. > *This is just a preview of the embed, you can dismiss it.*
  671. $try
  672. $footer[$var[t_footer]]
  673. $var[embed_data;$var[t_footer]]
  674. $endtry
  675. $if[$isValidHex[$var[t_color]]==true]
  676. $try
  677. $color[$var[t_color]]
  678. $catch
  679. $color[$var[main_color]]
  680. $var[t_color;$var[main_color]]
  681. $endtry
  682. $var[embed_data;$var[embed_data]≈$var[t_color]]
  683. $else
  684. $color[$var[main_color]]
  685. $var[embed_data;$var[embed_data]≈]
  686. $endif
  687. $try
  688. $title[$var[t_title]]
  689. $var[embed_data;$var[embed_data]≈$var[t_title]]
  690. $catch
  691. $title[Ticket Menu]
  692. $var[embed_data;$var[embed_data]≈]
  693. $endtry
  694. $try
  695. $description[$var[t_desc]]
  696. $var[embed_data;$var[embed_data]≈$var[t_desc]]
  697. $catch
  698. $description[Open a new Ticket using the interaction below this message!]
  699. $var[embed_data;$var[embed_data]≈]
  700. $endtry
  701. $try
  702. $image[$var[t_image]]
  703. $var[embed_data;$var[embed_data]≈$var[t_image]]
  704. $catch
  705. $var[embed_data;$var[embed_data]≈]
  706. $endtry
  707. $setChannelVar[tickets2;$var[embed_data]]
  708. $ephemeral
  709. $endif
  710. $c[here]
  711. $if[$customID==tkt_pnlact_delete-$authorID]
  712. $if[$input[panelid]==1]
  713. $var[input;$input[panelid]]
  714. $else
  715. $var[input;$sum[$input[panelid];1]]
  716. $endif
  717. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  718. $removeButtons
  719. $title[$var[sf_title]]
  720. $description[$var[sf_descr]]
  721. $color[$var[error_color]]
  722. $ephemeral
  723. $stop
  724. $endif
  725. $if[$isNumber[$var[input]]==false]
  726. $removeButtons
  727. $description[Invalid Panel ID given! It must be a valid ID from **1-$var[panel_limit]**, to know the IDs of all the existing panels just use the ticket menu "Setup Ticket Panel" button.]
  728. $color[$var[error_color]]
  729. $ephemeral
  730. $stop
  731. $endif
  732. $if[$or[$var[input]<1;$var[input]>$var[panel_limit]]==true]
  733. $removeButtons
  734. $description[Invalid Panel ID given! __It must be a valid ID from **1-$var[panel_limit]**__, you gave a numerical ID but it's not a valid one.]
  735. $color[$var[error_color]]
  736. $ephemeral
  737. $stop
  738. $endif
  739. $textSplit[$getChannelVar[tickets];≈]
  740. $if[$var[input]==1]
  741. $var[r;$splitText[2]]
  742. $else
  743. $var[r;$splitText[$var[input]]]
  744. $endif
  745. $if[$checkContains[$var[r];𝖑]==false]
  746. $removeButtons
  747. $description[Invalid Panel ID given! You gave a numerical ID but there are no panels linked to that ID.]
  748. $color[$var[error_color]]
  749. $ephemeral
  750. $stop
  751. $endif
  752. $try
  753. $setChannelVar[tickets;$replaceText[$getChannelVar[tickets];≈$var[r];;1]]
  754. $setChannelVar[tickets;$replaceText[$replaceText[$getChannelVar[tickets];$var[r];;1];≈≈;≈;-1]]
  755. $catch
  756. $description[Couldn't remove the panel with the given ID, please report this error to a Bot Developer.]
  757. $color[$var[error_color]]
  758. $ephemeral
  759. $stop
  760. $endtry
  761. $if[$var[input]==1] $var[p;1] $else $var[p;$sub[$var[input];1]] $endif
  762. $title[Success!]
  763. $description[> You successfully **deleted** the panel ID **$var[p]**!]
  764. $color[$var[success_color]]
  765. $ephemeral
  766. $stop $c[s]
  767. $endif
  768. $c[st]
  769. $if[$customID==tkt_add_pnl-$authorID]
  770. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  771. $stop
  772. $endif
  773. $removeButtons
  774. $textSplit[$getChannelVar[tickets];≈]
  775. $var[l;$getTextSplitLength]
  776. $var[n;1]
  777. $if[$var[l]>1]
  778. $eval[$repeatMessage[2;$repeatMessage[5;%{DOL}%optOff[
  779. %{DOL}%textSplit[%{DOL}%getChannelVar[tickets\]\;≈\]
  780. %{DOL}%var[s\;%{DOL}%splitText[%{DOL}%sum[%{DOL}%var[n\]\;1\]\]\]
  781. %{DOL}%textSplit[%{DOL}%var[s\]\;𝖑\]
  782. %{DOL}%var[%{DOL}%var[n\]_title\;%{DOL}%splitText[1\]\]
  783. %{DOL}%var[%{DOL}%var[n\]_description\;%{DOL}%splitText[2\]\]
  784. %{DOL}%if[%{DOL}%var[%{DOL}%var[n\]_description\]!=\]
  785. %{DOL}%try %{DOL}%addField[ID #%{DOL}%var[n\] - %{DOL}%var[%{DOL}%var[n\]_title\]\;```%{DOL}%var[%{DOL}%var[n\]_description\]```\] %{DOL}%endtry
  786. %{DOL}%endif
  787. %{DOL}%var[n\;%{DOL}%sum[%{DOL}%var[n\]\;1\]\]
  788. \]]]]
  789. $endif
  790. $title[Panels Management]
  791. $description[> Manage your ticket panels using the buttons below this embed, leave everything as default if you want to use a button to open the ticket instead (no panels), you can setup a maximum of **$var[panel_limit]** panels.]
  792. $color[$var[success_color]]
  793. $footer[When you are done configuring the panels press the "Done" button to save changes.]
  794. $if[$var[l]>$var[panel_limit]]
  795. $addButton[no;tkt_pnlact_mdl_add-$authorID;Max $var[panel_limit] panels!;primary;yes;]
  796. $else
  797. $addButton[no;tkt_pnlact_mdl_add-$authorID;Add new panel;primary;no;]
  798. $endif
  799. $if[$var[l]>1]
  800. $var[d;no]
  801. $else
  802. $var[d;yes]
  803. $endif
  804. $addButton[no;tkt_pnlact_mdl_edit-$authorID;Edit panel;secondary;$var[d];]
  805. $addButton[no;tkt_pnlact_mdl_delete-$authorID;Delete panel;danger;$var[d];]
  806. $addButton[no;tkt_pnlact_done-$authorID;Done;success;no;]
  807. $ephemeral
  808. $stop $c[s]
  809. $endif
  810. $if[$customID==tkt_pnlact_done-$authorID]
  811. $removeButtons
  812. $title[Success!]
  813. $description[> Successfully saved changes! No errors detected.]
  814. $color[$var[success_color]]
  815. $try $var[d;$deleteIn[3s]] $endtry
  816. $stop $c[s]
  817. $endif
  818.  
  819. $if[$checkContains[$customID;tkt_pnlact_]==true]
  820. $if[$checkContains[$customID;$authorID]==true]
  821. $try $var[d;$deleteIn[5s]] $endtry
  822. $endif
  823. $endif
  824. $if[$customID==tkt_open]
  825. $removeButtons
  826. $var[u;$getChannelVar[tickets;$channelID]]
  827. $var[user;$var[u]]
  828. $var[guild;$guildID]
  829. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  830. $removeButtons
  831. $title[$var[sf_title]]
  832. $description[$var[sf_descr]]
  833. $color[$var[error_color]]
  834. $ephemeral
  835. $stop
  836. $endif
  837. $try
  838. $modifyChannelPerms[$channelID;+readmessages;+sendmessages;+embedlinks;+attachfiles;$var[u]]
  839. $catch
  840. $editChannelPerms[$channelID;$var[u];+sendmessages;+readmessages;+embedlinks;+attachfiles]
  841. $endtry
  842. $if[$checkContains[$channelName[$channelID];solved-]==false]
  843. $title[Already Open!]
  844. $description[Hey **$username**, this Ticket is already flagged as **open**! Are you trying to close it back?
  845. You can use the Staff Panel to close this ticket back.]
  846. $color[$var[error_color]]
  847. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji]]
  848. $ephemeral
  849. $stop
  850. $endif
  851. $async[oa]
  852. $useChannel[$channelID]
  853. $sendEmbedMessage[$channelID;<@$var[u]>;Ticket Open!;;This Ticket has been opened by **$username[$authorID]#$discriminator[$authorID]**!
  854. ```Ticket Author Username: $username[$var[u]]#$discriminator[$var[u]]
  855. Ticket Author's ID: $var[u]
  856. Ticket unarchived by $username[$authorID]#$discriminator[$authorID]```;$var[success_color];$serverName[$guildID];$serverIcon[$guildID];;;;;;no]
  857. $optOff[$modifyChannel[$channelID;$replaceText[$channelName[$channelID];solved-;;-1]]]
  858. $endasync
  859. $removeButtons
  860. $title[Ticket opened back!]
  861. $description[> ☑️ This Ticket is now **Open**! Read & Send Messages permissions has been granted back to <@$var[u]>, the Ticket's author. ]
  862. $color[$var[success_color]]
  863. $ephemeral
  864. $stop $c[s]
  865. $endif
  866.  
  867. $if[$customID==tkt_closecancel]
  868. $removeButtons
  869. $try
  870. $setUserVar[tickets;$replaceText[$getUserVar[tickets];-$channelIDClose;;-1];$authorID]
  871. $catch
  872. $setUserVar[tickets;;$authorID]
  873. $endtry
  874. $description[> ☑️ Successfully cancelled this action! This Ticket **won't** get closed, if you want to close it you can use the **Close Ticket** button again.]
  875. $color[$var[success_color]]
  876. $stop $c[s]
  877. $endif
  878.  
  879. $if[$customID==tkt_pnlact_edit-$authorID]
  880. $if[$input[panelid]==1]
  881. $var[input;$input[panelid]]
  882. $else
  883. $var[input;$sum[$input[panelid];1]]
  884. $endif
  885. $var[newtitle;$input[paneltitle]]
  886. $var[newdesc;$input[paneldescription]]
  887. $if[$isNumber[$var[input]]==false]
  888. $removeButtons
  889. $description[Invalid Panel ID given! It must be a valid ID from **1-$var[panel_limit]**, to know the IDs of all the existing panels just use the ticket menu "Setup Ticket Panel" button.]
  890. $color[$var[error_color]]
  891. $ephemeral
  892. $stop
  893. $endif
  894. $if[$var[input]!=8]
  895. $if[$or[$var[input]<1;$var[input]>$var[panel_limit]]==true]
  896. $removeButtons
  897. $description[Invalid Panel ID given! __It must be a valid ID from **1-$var[panel_limit]**__, you gave a numerical ID but it's not a valid one.]
  898. $color[$var[error_color]]
  899. $ephemeral
  900. $stop
  901. $endif
  902. $endif
  903. $textSplit[$getChannelVar[tickets];≈]
  904. $if[$var[input]==1]
  905. $var[r;$splitText[2]]
  906. $else
  907. $var[r;$splitText[$var[input]]]
  908. $endif
  909. $if[$checkContains[$var[r];𝖑]==false]
  910. $removeButtons
  911. $description[Invalid Panel ID given! You gave a numerical ID but there are no panels linked to that ID.]
  912. $color[$var[error_color]]
  913. $ephemeral
  914. $stop
  915. $endif
  916. $textSplit[$var[r];𝖑]
  917. $if[$var[newtitle]==]
  918. $var[newtitle;$splitText[1]]
  919. $var[title_extra; — Nothing changed!]
  920. $endif
  921. $if[$var[newdesc]==]
  922. $var[newdesc;$splitText[2]]
  923. $var[desc_extra; — Nothing changed!]
  924. $endif
  925. $try
  926. $setChannelVar[tickets;$replaceText[$getChannelVar[tickets];$var[r];$var[newtitle]𝖑$var[newdesc];1]]
  927. $catch
  928. $try
  929. $setChannelVar[tickets;$replaceText[$getChannelVar[tickets];$var[r];$var[newtitle]𝖑$cropText[$var[newdesc];30;];1]]
  930. $catch
  931. $try
  932. $setChannelVar[tickets;$replaceText[$getChannelVar[tickets];$var[r];$var[newtitle]𝖑$cropText[$var[newdesc];20;];1]]
  933. $catch
  934. $title[Unexpected Error!]
  935. $description[Sorry, there has been an issue while trying to edit this panel, all the values you gave were right, the error is from our side!]
  936. $addField[Error Message;```Exceeded variable value while changing Ticket Panel title/description (Value is "$charCount[$getChannelVar[tickets]]")```;yes]
  937. $footer[Please report this to the Bot Developer, if this isn't fixed just open a new ticket menu setup.]
  938. $color[$var[error_color]]
  939. $endtry
  940. $endtry
  941. $endtry
  942. $title[Success!]
  943. $description[> Successfully edited the panel ID **$var[input]**!]
  944. $if[$var[input]==1]
  945. $addField[ID;```$var[input]```;yes]
  946. $else
  947. $addField[ID;```$sub[$var[input];1]```;yes]
  948. $endif
  949. $addField[New Title$var[title_extra];```$var[newtitle]```;yes]
  950. $addField[New Description$var[desc_extra];```$var[newdesc]```;yes]
  951. $color[$var[success_color]]
  952. $ephemeral
  953. $stop $c[s]
  954. $endif
  955. $if[$customID==tkt_pnlact_add-$authorID]
  956. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  957. $removeButtons
  958. $title[$var[sf_title]]
  959. $description[$var[sf_descr]]
  960. $color[$var[error_color]]
  961. $ephemeral
  962. $stop
  963. $endif
  964. $textSplit[$getChannelVar[tickets];≈]
  965. $var[l;$getTextSplitLength]
  966. $if[$var[l]>$var[panel_limit]]
  967. $description[You cannot create another Ticket Panel, there's a limit of **$var[panel_limit]** panels! You can either remove a panel or create another ticket menu.]
  968. $color[$var[error_color]]
  969. $ephemeral
  970. $stop
  971. $endif
  972. $title[Success!]
  973. $description[Successfully added panel ID **$var[l]**!]
  974. $addField[Panel ID;```$var[l]```;yes]
  975. $addField[Panel Title;```$input[paneltitle]```;yes]
  976. $addField[Panel Description;```$input[paneldescription]```;yes]
  977. $color[$var[success_color]]
  978. $try
  979. $setChannelVar[tickets;$getChannelVar[tickets]≈$input[paneltitle]𝖑$input[paneldescription]]
  980. $catch
  981. $try
  982. $setChannelVar[tickets;$getChannelVar[tickets]≈$input[paneltitle]𝖑$cropText[$input[paneldescription];30]~]
  983. $catch
  984. $setChannelVar[tickets;≈$input[paneltitle]𝖑$input[paneldescription]]
  985. $endtry
  986. $endtry
  987. $ephemeral
  988. $stop $c[s]
  989. $endif $c[e]
  990. $if[$customID==tkt_pnl_send-$authorID]
  991. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  992. $stop
  993. $endif
  994. $removeButtons
  995. $textSplit[$getChannelVar[tickets2];≈]
  996. $var[t_footer;$splitText[1]]
  997. $var[t_color;$splitText[2]]
  998. $var[t_title;$splitText[3]]
  999. $var[t_desc;$splitText[4]]
  1000. $var[t_image;$splitText[5]]
  1001. $textSplit[$getChannelVar[tickets];≈]
  1002. $var[l;$getTextSplitLength]
  1003. $var[n;1]
  1004. $if[$var[l]>1]
  1005. $var[type;selection menu]
  1006. $newSelectMenu[tmenu-open;1;1;Select a Ticket panel!]
  1007. $eval[$repeatMessage[2;$repeatMessage[5;%{DOL}%optOff[
  1008. %{DOL}%textSplit[%{DOL}%getChannelVar[tickets\]\;≈\]
  1009. %{DOL}%var[s\;%{DOL}%splitText[%{DOL}%sum[%{DOL}%var[n\]\;1\]\]\]
  1010. %{DOL}%textSplit[%{DOL}%var[s\]\;𝖑\]
  1011. %{DOL}%var[%{DOL}%var[n\]_title\;%{DOL}%splitText[1\]\]
  1012. %{DOL}%var[%{DOL}%var[n\]_description\;%{DOL}%splitText[2\]\]
  1013. %{DOL}%if[%{DOL}%var[%{DOL}%var[n\]_description\]!=\]
  1014. %{DOL}%try
  1015. %{DOL}%addSelectMenuOption[tmenu-open\;%{DOL}%var[%{DOL}%var[n\]_title\]\;tkt_mdl_o-%{DOL}%replaceText[%{DOL}%var[%{DOL}%var[n\]_title\]-%{DOL}%var[n\]\;-\;~\;-1\]\;%{DOL}%var[%{DOL}%var[n\]_description\]\]
  1016. %{DOL}%endtry
  1017. %{DOL}%endif
  1018. %{DOL}%var[n\;%{DOL}%sum[%{DOL}%var[n\]\;1\]\]
  1019. \]]]]
  1020. $else
  1021. $var[type;button]
  1022. $addButton[no;tkt_mdl_op-0;Open a Ticket;primary;no;$var[openticket_emoji]]
  1023. $endif
  1024. $if[$var[t_title]!=]
  1025. $title[$var[t_title]]
  1026. $else
  1027. $title[Ticket Menu]
  1028. $endif
  1029. $if[$var[t_desc]!=]
  1030. $description[$var[t_desc]]
  1031. $else
  1032. $description[Open a new Ticket using the $var[type] below this message!]
  1033. $endif
  1034. $if[$isValidHex[$var[t_color]]==true]
  1035. $color[$var[t_color]]
  1036. $else
  1037. $color[$var[main_color]]
  1038. $endif
  1039. $if[$var[t_footer]!=]
  1040. $footer[$var[t_footer]]
  1041. $endif
  1042. $if[$var[t_image]!=]
  1043. $try
  1044. $image[$var[t_image]]
  1045. $catch
  1046. $try
  1047. $image[$var[default_image]]
  1048. $endtry
  1049. $endtry
  1050. $else
  1051. $try
  1052. $image[$var[default_image]]
  1053. $endtry
  1054. $endif
  1055. $stop $c[s]
  1056. $endif
  1057. $if[$customID==tkt_pnel]
  1058. $removeButtons
  1059. $if[$var[is_staff]==false]
  1060. $removeButtons
  1061. $title[$var[sf_title]]
  1062. $description[$var[sf_descr]]
  1063. $color[$var[error_color]]
  1064. $ephemeral
  1065. $stop
  1066. $endif
  1067. $removeComponent[$customID]
  1068. $var[u;$getChannelVar[tickets;$channelID]]
  1069. $var[user;$var[u]]
  1070. $title[Staff Panel]
  1071. $description[Hey **$username**, this is your staff panel! You can manage this ticket using the buttons below this message.]
  1072. $color[$var[main_color]]
  1073. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1074. $addButton[no;tkt_sticky;Mark as non-Sticky;success;no;$var[sticky_emoji]]
  1075. $endif
  1076. $if[$checkContains[$channelName[$channelID];solved-]==true]
  1077. $addButton[no;tkt_open;Open Ticket;success;no;$var[open_emoji]]
  1078. $else
  1079. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1080. $if[$var[hide_on_sticky]!=true]
  1081. $addButton[no;tkt_slvd--$authorID;Close & Save;primary;yes;$var[solved_emoji]]
  1082. $endif
  1083. $else
  1084. $addButton[no;tkt_slvd--$authorID;Close & Save;primary;no;$var[solved_emoji]]
  1085. $endif
  1086. $endif
  1087. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1088. $if[$var[hide_on_sticky]!=true]
  1089. $addButton[no;tkt_close;Close Ticket;danger;yes;$var[close_emoji]]
  1090. $endif
  1091. $else
  1092. $addButton[no;tkt_close;Close Ticket;danger;no;$var[close_emoji]]
  1093. $endif
  1094. $if[$getChannelVar[tickets3]!=]
  1095. $if[$userExists[$getChannelVar[tickets3]]==true]
  1096. $var[claimed_by;$getChannelVar[tickets3]]
  1097. $endif
  1098. $endif
  1099. $if[$var[claimed_by]==]
  1100. $addButton[no;tkt_claim;Claim Ticket;secondary;no;$var[claim_emoji]]
  1101. $else
  1102. $if[$or[$var[claimed_by]==$authorID;$isAdmin[$authorID]==true]==true]
  1103. $addButton[no;tkt_claim;Unclaim Ticket;secondary;no;$var[claim_emoji]]
  1104. $else
  1105. $addButton[no;tkt_claim;Claimed by $cropText[$username[$authorID];6;~];secondary;yes;$var[claim_emoji]]
  1106. $endif
  1107. $endif
  1108. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==false]
  1109. $addButton[no;tkt_sticky;Mark as Sticky;secondary;no;$var[sticky_emoji]]
  1110. $endif
  1111. $if[$var[hide_on_sticky]==true]
  1112. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1113. $var[berk_4ever;no]
  1114. $else
  1115. $var[berk_4ever;yes]
  1116. $endif
  1117. $else
  1118. $var[berk_4ever;yes]
  1119. $endif
  1120. $addButton[$var[berk_4ever];tkt_usr;User Info;secondary;no;$var[info_emoji]]
  1121. $ephemeral
  1122. $stop $c[s]
  1123. $endif
  1124. $if[$customID==tkt_claim]
  1125. $removeButtons
  1126. $if[$var[is_staff]==false]
  1127. $removeButtons
  1128. $title[$var[sf_title]]
  1129. $description[$var[sf_descr]]
  1130. $color[$var[error_color]]
  1131. $ephemeral
  1132. $stop
  1133. $endif
  1134. $var[u;$getChannelVar[tickets;$channelID]]
  1135. $var[user;$var[u]]
  1136. $var[claimed_msg;| Claimed by $username[$authorID]#$discriminator[$authorID]]
  1137. $var[format;$channelID $authorID $channelID]
  1138. $var[format;$replaceText[$var[format]; ;;-1]]
  1139. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji]]
  1140. $if[$getChannelVar[tickets3]!=]
  1141. $if[$userExists[$getChannelVar[tickets3]]==true]
  1142. $var[claimed_by;$getChannelVar[tickets3]]
  1143. $endif
  1144. $endif
  1145. $if[$var[claimed_by]==]
  1146. $async[logs_block]
  1147. $if[$serverChannelExists[$var[logs]]]
  1148. $try
  1149. $sendEmbedMessage[$var[logs];;Ticked Claimed;;Ticket ``#$channelName[$channelID]`` (<#$channelID>) by <@$var[u]> (**$username[$var[u]]#$discriminator[$var[u]]**) has been __claimed__ by the staff member <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1150. ;$var[success_color];;;;;;;;no]
  1151. $endtry
  1152. $endif
  1153. $endasync
  1154. $sendEmbedMessage[$channelID;;Ticked Claimed;;Hey **$username[$var[u]]**, this ticket has been claimed by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1155. ;$var[main_color];;;;;;;;no]
  1156. $setChannelVar[tickets3;$authorID]
  1157. $title[Successfully claimed!]
  1158. $description[> ☑️ **$username[$authorID]** You successfully claimed this ticket!]
  1159. $color[$var[success_color]]
  1160. $textSplit[$getServerVar[tickets3];-]
  1161. $var[ts1;$splitText[1]]
  1162. $var[ts2;$splitText[2]]
  1163. $textSplit[$var[ts1];,]
  1164. $try $editChannelPerms[$channelID;$authorID;+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry
  1165. $if[$roleExists[$splitText[1]]==true] $try $editChannelPerms[$channelID;$splitText[1];-sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1166. $if[$roleExists[$splitText[2]]==true] $try $editChannelPerms[$channelID;$splitText[2];-sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1167. $if[$roleExists[$splitText[3]]==true] $try $editChannelPerms[$channelID;$splitText[3];-sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1168. $try
  1169. $optOff[$modifyChannel[$channelID;!unchanged;$channelTopic $var[claimed_msg] ($authorID)]]
  1170. $endtry
  1171. $else
  1172. $if[$isAdmin[$authorID]==false]
  1173. $if[$authorID!=$var[claimed_by]]
  1174. $removeButtons
  1175. $description[Hey **$username**, you can't claim this ticket! This ticket has been claimed by <@$var[claimed_by]>, they or an administrator must unclaim it.]
  1176. $color[$var[error_color]]
  1177. $stop
  1178. $endif
  1179. $endif
  1180. $async[logs_block]
  1181. $if[$serverChannelExists[$var[logs]]]
  1182. $try
  1183. $sendEmbedMessage[$var[logs];;Ticked Unclaimed;;Ticket ``#$channelName[$channelID]`` (<#$channelID>) by <@$var[u]> (**$username[$var[u]]#$discriminator[$var[u]]**) has been __unclaimed__ by the staff member <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1184. ;$var[neutral_color];;;;;;;;no]
  1185. $endtry
  1186. $endif
  1187. $endasync
  1188. $sendEmbedMessage[$channelID;;Ticked Unclaimed;;Hey **$username[$var[u]]**, this ticket has been __unclaimed__ by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1189. ;$var[main_color];;;;;;;;no]
  1190. $setChannelVar[tickets3;]
  1191. $title[Successfully unclaimed!]
  1192. $description[> ☑️ **$username[$authorID]** You successfully marked this ticket as **unclaimed**!]
  1193. $color[$var[success_color]]
  1194. $textSplit[$getServerVar[tickets3];-]
  1195. $var[ts1;$splitText[1]]
  1196. $var[ts2;$splitText[2]]
  1197. $textSplit[$var[ts1];,]
  1198. $try $editChannelPerms[$channelID;$authorID;/sendmessages;/readmessages;+embedlinks;+attachfiles] $endtry
  1199. $if[$roleExists[$splitText[1]]==true] $try $editChannelPerms[$channelID;$splitText[1];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1200. $if[$roleExists[$splitText[2]]==true] $try $editChannelPerms[$channelID;$splitText[2];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1201. $if[$roleExists[$splitText[3]]==true] $try $editChannelPerms[$channelID;$splitText[3];+sendmessages;+readmessages;+embedlinks;+attachfiles] $endtry $endif
  1202. $try
  1203. $async[topic_change]
  1204. $replyIn[10s]
  1205. $var[new_topic;$replaceText[$replaceText[$channelTopic;$var[claimed_msg];;-1];($authorID);;-1]]
  1206. $optOff[$modifyChannel[$channelID;!unchanged;$var[new_topic]]]
  1207. $endasync
  1208. $endtry
  1209. $endif
  1210. $stop $c[s]
  1211. $endif
  1212. $if[$customID==tkt_sticky]
  1213. $removeButtons
  1214. $if[$var[is_staff]==false]
  1215. $removeButtons
  1216. $title[$var[sf_title]]
  1217. $description[$var[sf_descr]]
  1218. $color[$var[error_color]]
  1219. $ephemeral
  1220. $stop
  1221. $endif
  1222. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji]]
  1223. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1224. $setChannelVar[tickets2;$replaceText[$getChannelVar[tickets2];%sticky%;;-1]]
  1225. $title[Successfully Unmarked]
  1226. $description[Ticket successfully **unmarked** as sticky! Ticket's author and Staff is now able to close this ticket.]
  1227. $color[$var[success_color]]
  1228. $async[logs_block]
  1229. $if[$serverChannelExists[$var[logs]]]
  1230. $try
  1231. $sendEmbedMessage[$var[logs];;Ticked Unmarked as Sticky;;Ticket ``#$channelName[$channelID]`` (<#$channelID>) has been **unmarked as sticky** by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1232. ;$var[neutral_color];;;;;;;;no]
  1233. $endtry
  1234. $endif
  1235. $endasync
  1236. $else
  1237. $setChannelVar[tickets2;$getChannelVar[tickets2] %sticky%]
  1238. $title[Successfully Marked]
  1239. $description[Ticket successfully **marked** as sticky! Ticket's author and Staff is not able to close this ticket anymore till it gets unmarked as sticky.]
  1240. $color[$var[success_color]]
  1241. $async[logs_block]
  1242. $if[$serverChannelExists[$var[logs]]]
  1243. $try
  1244. $sendEmbedMessage[$var[logs];;Ticked Marked as Sticky;;Ticket ``#$channelName[$channelID]`` (<#$channelID>) has been **marked as sticky** by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1245. ;$var[success_color];;;;;;;;no]
  1246. $endtry
  1247. $endif
  1248. $endasync
  1249. $endif
  1250. $stop $c[s]
  1251. $endif
  1252. $c[ ... Thanks Xloxn#4050 for the "Acknowledgements" and "Key permissions" fields. ]
  1253. $if[$checkContains[$customID;tkt_usr]==true]
  1254. $removeButtons
  1255. $textSplit[$customID;-]
  1256. $if[$splitText[2]!=]
  1257. $var[u;$splitText[2]]
  1258. $var[type;logs]
  1259. $else
  1260. $var[u;$getChannelVar[tickets;$channelID]]
  1261. $endif
  1262. $var[user;$var[u]]
  1263. $if[$userExists[$var[u]]==false]
  1264. $title[Ticket Panel (Failed!)]
  1265. $description[> Couldn't retrieve the user information about this ticket's author!]
  1266. $color[$var[error_color]]
  1267. $if[$var[type]==logs]
  1268. $ephemeral
  1269. $endif
  1270. $stop
  1271. $endif
  1272. $var[keyperms;$trimSpace[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$toTitleCase[$replaceText[$toLowercase[$userPerms[$var[u];-1;, ], ];_; ;-1]];Use External Emojis, ;;-1];Use External Stickers, ;;-1];Connect ,;;-1];Request To Speak, ;;-1];Use Vad, ;;-1];Use Application Commands, ;;-1];Create Public Threads, ;;-1];Send Messages In Threads, ;;-1];Manage Emojis And Stickers, ;;-1];Connect, ;;-1];Speak, ;;-1];Move Members, ;;-1];Read Message History, ;;-1];Create Instant Invite, ;;-1];Send Tts Messages, ;;-1];Embed Links, ;;-1];View Guild Insights, ;;-1];Manage Events, ;;-1];Priority Speaker, ;;-1];Stream, ;;-1];Add Reactions, ;;-1];Mute Members, ;;-1];Deafen Members, ;;-1];Manage Threads, ;;-1];View Audit Log, ;;-1];Attach Files, ;;-1];Manage Guild, ;;-1];Create Private Threads, ;;-1];Change Nickname, ;;-1];Manage Webhooks, ;;-1]]]
  1273. $var[keyperms;$trimSpace[$var[keyperms]]]
  1274. $var[keyperms;$cropText[$var[keyperms];$sub[$charCount[$var[keyperms]];1];]]
  1275. $if[$serverOwner==$var[u]]
  1276. $var[Acknowledgements;Server Owner]
  1277. $elseif[$checkUserPerms[$var[u];manageserver]==true]
  1278. $var[Acknowledgements;Server Admin]
  1279. $elseif[$checkUserPerms[$var[u];admin]==true]
  1280. $var[Acknowledgements;Administrator]
  1281. $elseif[$or[$checkUserPerms[$var[u];kick]==true;$checkUserPerms[$var[u];ban]==true;$checkUserPerms[$var[user];managemessages]==true;$checkUserPerms[$var[u];moderatemembers]==true]==true]
  1282. $var[Acknowledgements;Moderator]
  1283. $elseif[$and[$checkUserPerms[$var[user];admin;ban;kick]==false;$checkUserPerms[$var[u];sendmessages]==true]==true]
  1284. $var[Acknowledgements;Normal Member]
  1285. $elseif[$checkUserPerms[$var[u];sendmessages]==false]
  1286. $var[Acknowledgements;Normal Member]
  1287. $else
  1288. $var[Acknowledgements;Normal Member]
  1289. $endif
  1290. $if[$var[Acknowledgements]==]
  1291. $var[Acknowledgements;Unknown, couldn't find!]
  1292. $endif
  1293. $if[$var[keyperms]==]
  1294. $var[keyperms;Couldn't find!]
  1295. $endif
  1296. $title[Ticket Button - User Info]
  1297. $author[$username[$var[u]]#$discriminator[$var[u]]'s user info]
  1298. $authorIcon[$userAvatar[$var[u]]]
  1299. $description[> :identification_card: Information about the Ticket's author.]
  1300. $addField[Identificators;``$var[u]`` <@$var[u]>;no]
  1301. $addField[Joined;```$userJoined[$var[u];Mon, Jan 2, 2006 3:04 PM]```;yes]
  1302. $addField[Registered;```$userJoinedDiscord[$var[u];Mon, Jan 2, 2006 3:04 PM]```;yes]
  1303. $addField[Key Permissions;```$var[keyperms]```;no]
  1304. $addField[Acknowledgements;
  1305. ```$var[Acknowledgements]```
  1306. ;no]
  1307. $thumbnail[$userAvatar[$var[u]]]
  1308. $if[$var[type]!=logs]
  1309. $addButton[no;tkt_pnel;Back to the Panel;primary;no;$var[back_to_panel_emoji]]
  1310. $endif
  1311. $addButton[no;tkt_avtr-$var[u];User Avatar;secondary;no;]
  1312. $color[$var[main_color]]
  1313. $if[$var[type]==logs]
  1314. $ephemeral
  1315. $endif
  1316. $stop $c[s]
  1317. $endif
  1318. $if[$checkContains[$customID;tkt_avtr-]==true]
  1319. $removeButtons
  1320. $textSplit[$customID;-]
  1321. $var[u;$splitText[2]]
  1322. $var[user;$var[u]]
  1323. $var[cut;$replaceText[$replaceText[$replaceText[$replaceText[$userAvatar[$var[u]];gif;;1];png;;1];jpg;;1];webp;;1]]
  1324. $var[av;$userAvatar[$var[u]]]
  1325. $title[Ticket Button - User Info - Avatar]
  1326. $author[$username[$var[u]]#$discriminator[$var[u]]'s avatar!]
  1327. $authorIcon[$userAvatar[$var[u]]]
  1328. $image[$var[av]?size=2048]
  1329. $if[$checkContains[$var[av];gif]==true]
  1330. $addButton[no;$var[av]?size=2048;GIF;link;no;]
  1331. $endif
  1332. $addButton[no;$var[cut]png?size=2048;PNG;link;no;]
  1333. $addButton[no;$var[cut]jpg?size=2048;JPG;link;no;]
  1334. $addButton[no;$var[cut]webp?size=2048;WEBP;link;no;]
  1335. $color[$var[main_color]]
  1336. $ephemeral
  1337. $stop $c[s]
  1338. $endif
  1339. $if[$customID==tkt_close]
  1340. $removeButtons
  1341. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1342. $title[You can't close this Ticket!]
  1343. $description[Hey **$username**, this Ticket is marked as **Sticky**! It can't be closed till a staff member unmarks it using the Ticket Panel.]
  1344. $color[$var[error_color]]
  1345. $ephemeral
  1346. $stop
  1347. $endif
  1348. $var[u;$getChannelVar[tickets;$channelID]]
  1349. $var[user;$var[u]]
  1350. $title[Closing Ticket!]
  1351. $description[Hey <@$authorID>, this ticket is closing <t:$sum[$getTimestamp;$var[close_in]]:R>!]
  1352. $color[$var[error_color]]
  1353. $addButton[no;tkt_closenow;Close Now;danger;no;$var[close_emoji]]
  1354. $addButton[no;tkt_closecancel;Cancel;primary;no;]
  1355. $try
  1356. $setUserVar[tickets;$getUserVar[tickets]-$channelIDClose;$authorID]
  1357. $catch
  1358. $setUserVar[tickets;$channelIDClose;$authorID]
  1359. $endtry
  1360. $var[ch;$channelID]
  1361. $var[guild;$guildID]
  1362. $async[close_ticket]
  1363. $replyIn[$var[close_in]s]
  1364. $if[$channelExists[$channelID]==false]
  1365. $stop
  1366. $endif
  1367. $if[$checkContains[$getUserVar[tickets;$authorID];$var[ch]Close]==true]
  1368. $try
  1369. $if[$checkContains[$channelName[$channelID];solved-]==false]
  1370. $try
  1371. $var[dm_id;$sendEmbedMessage[$dmChannelID[$var[u]];;Ticket Closed;$getBotInvite;Hey **$username[$var[u]]**, your ticket ``#$channelName[$channelID]`` has been closed by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1372.  
  1373. $replaceText[$var[rt_msg];{server};$serverName[$guildID];-1];$var[main_color];$serverName[$guildID];$serverIcon[$guildID];$var[rt_footer];;;;;yes]]
  1374. $useChannel[$dmChannelID[$var[u]]]
  1375. $if[$var[rating]==true]
  1376. $addButton[no;tkt_rtng-verybad-$var[guild];Very bad!;danger;no;;$var[dm_id]]
  1377. $addButton[no;tkt_rtng-bad-$var[guild];Bad!;danger;no;;$var[dm_id]]
  1378. $addButton[no;tkt_rtng-regular-$var[guild];Regular;primary;no;;$var[dm_id]]
  1379. $addButton[no;tkt_rtng-good-$var[guild];Good!;success;no;;$var[dm_id]]
  1380. $addButton[no;tkt_rtng-verygood-$var[guild];Very good!;success;no;;$var[dm_id]]
  1381. $else
  1382. $try
  1383. $addButton[no;$getBotInvite;Invite $username[$botID]!;link;no;;$var[dm_id]]
  1384. $catch
  1385. $addButton[no;$getBotInvite;Invite me!;link;no;;$var[dm_id]]
  1386. $endtry
  1387. $endif
  1388. $endtry
  1389. $endif
  1390. $setUserVar[tickets2;;$var[u]]
  1391. $if[$serverChannelExists[$var[logs]]==true]
  1392. $try
  1393. $var[logs_id;$sendEmbedMessage[$var[logs];;;;
  1394. > Ticket ``#$channelName[$var[ch]]`` has been closed <t:$getTimestamp:R>! (<t:$getTimestamp:F>)
  1395.  
  1396. **Ticket's Author**
  1397. ```$username[$var[u]]#$discriminator[$var[u]] ($var[u])```**Closed By**
  1398. ```$username[$authorID]#$discriminator[$authorID] ($authorID)```**Ticket ID**
  1399. ```$var[ch]```
  1400. ;$var[error_color]
  1401. ;Logs - Ticket Closed!
  1402. ;
  1403. ;;;;;yes;yes]]
  1404. $endtry
  1405. $try
  1406. $async[logs_btns]
  1407. $useChannel[$var[logs]]
  1408. $addButton[no;tkt_usr-$authorID;Ticket Author's info;secondary;no;$var[info_emoji];$var[logs_id]]
  1409. $endasync
  1410. $endtry
  1411. $endif
  1412. $deleteChannels[$var[ch]]
  1413. $catch
  1414. $channelSendMessage[$var[ch];Hey <@$authorID>, there's been an error trying to close this ticket, I couldn't delete the ticket channel, please make sure I have the `manage channels` permission.]
  1415. $endtry
  1416. $endif
  1417. $endasync
  1418. $ephemeral
  1419. $stop $c[s]
  1420. $endif
  1421. $c[ here close cancel ]
  1422. $if[$customID==tkt_closenow]
  1423. $var[u;$getChannelVar[tickets;$channelID]]
  1424. $var[user;$var[u]]
  1425. $var[guild;$guildID]
  1426. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1427. $title[You can't close this Ticket!]
  1428. $description[Hey **$username**, this Ticket is marked as **Sticky**! It can't be closed till a staff member unmarks it using the Ticket Panel.]
  1429. $color[$var[error_color]]
  1430. $ephemeral
  1431. $stop
  1432. $endif
  1433. $if[$checkContains[$channelName[$channelID];solved-]==false]
  1434. $try
  1435. $var[dm_id;$sendEmbedMessage[$dmChannelID[$var[u]];;Ticket Closed;$getBotInvite;Hey **$username[$var[u]]**, your ticket ``#$channelName[$channelID]`` has been closed by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1436.  
  1437. $replaceText[$var[rt_msg];{server};$serverName[$guildID];-1];$var[main_color];$serverName[$guildID];$serverIcon[$guildID];$var[rt_footer];;;;;yes]]
  1438. $useChannel[$dmChannelID[$var[u]]]
  1439. $if[$var[rating]==true]
  1440. $addButton[no;tkt_rtng-verybad-$var[guild];Very bad!;danger;no;;$var[dm_id]]
  1441. $addButton[no;tkt_rtng-bad-$var[guild];Bad!;danger;no;;$var[dm_id]]
  1442. $addButton[no;tkt_rtng-regular-$var[guild];Regular;primary;no;;$var[dm_id]]
  1443. $addButton[no;tkt_rtng-good-$var[guild];Good!;success;no;;$var[dm_id]]
  1444. $addButton[no;tkt_rtng-verygood-$var[guild];Very good!;success;no;;$var[dm_id]]
  1445. $else
  1446. $try
  1447. $addButton[no;$getBotInvite;Invite $username[$botID]!;link;no;;$var[dm_id]]
  1448. $catch
  1449. $addButton[no;$getBotInvite;Invite me!;link;no;;$var[dm_id]]
  1450. $endtry
  1451. $endif
  1452. $endtry
  1453. $endif
  1454. $if[$serverChannelExists[$var[logs]]==true]
  1455. $try
  1456. $var[ch;$channelID]
  1457. $var[logs_id;$sendEmbedMessage[$var[logs];;;;
  1458. > Ticket ``#$channelName[$var[ch]]`` has been closed <t:$getTimestamp:R>! (<t:$getTimestamp:F>)
  1459.  
  1460. **Ticket's Author**
  1461. ```$username[$var[u]]#$discriminator[$var[u]] ($var[u])```**Closed By**
  1462. ```$username[$authorID]#$discriminator[$authorID] ($authorID)```**Ticket ID**
  1463. ```$var[ch]```
  1464. ;$var[error_color]
  1465. ;Logs - Ticket Closed!
  1466. ;
  1467. ;;;;;yes;yes]]
  1468. $endtry
  1469. $try
  1470. $async[logs_btns]
  1471. $useChannel[$var[logs]]
  1472. $addButton[no;tkt_usr-$authorID;Ticket Author's info;secondary;no;$var[info_emoji];$var[logs_id]]
  1473. $endasync
  1474. $endtry
  1475. $endif
  1476. $deleteChannels[$channelID]
  1477. $setUserVar[tickets2;;$var[u]]
  1478. $stop $c[s]
  1479. $endif
  1480. $if[$checkContains[$customID;tkt_slvd]==true]
  1481. $removeButtons
  1482. $if[$or[$var[is_staff]==false;$checkUserPerms[$authorID;manageserver]==false]==true]
  1483. $removeButtons
  1484. $title[$var[sf_title]]
  1485. $description[$var[sf_descr]]
  1486. $color[$var[error_color]]
  1487. $ephemeral
  1488. $stop
  1489. $endif
  1490. $var[u;$getChannelVar[tickets;$channelID]]
  1491. $var[user;$var[u]]
  1492. $var[guild;$guildID]
  1493. $if[$checkContains[$getChannelVar[tickets2];%sticky%]==true]
  1494. $title[You can't close this Ticket!]
  1495. $description[Hey **$username**, this Ticket is marked as **Sticky**! It can't be closed till a staff member unmarks it using the Ticket Panel.]
  1496. $color[$var[error_color]]
  1497. $ephemeral
  1498. $stop
  1499. $endif
  1500. $if[$checkContains[$channelName[$channelID];solved-]==true]
  1501. $title[Already Closed & Solved!]
  1502. $description[Hey **$username**, this Ticket is already flagged as Closed & Solved! Are you trying to open it back?
  1503. You can use the Staff Panel to open this ticket back.]
  1504. $color[$var[error_color]]
  1505. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji]]
  1506. $ephemeral
  1507. $stop
  1508. $endif
  1509. $try
  1510. $var[dm_id;$sendEmbedMessage[$dmChannelID[$var[u]];;Ticket Closed;$getBotInvite;Hey **$username[$var[u]]**, your ticket ``#$channelName[$channelID]`` has been closed by <@$authorID> (**$username[$authorID]#$discriminator[$authorID]**)!
  1511.  
  1512. $replaceText[$var[rt_msg];{server};$serverName[$guildID];-1];$var[main_color];$serverName[$guildID];$serverIcon[$guildID];$var[rt_footer];;;;;yes]]
  1513. $useChannel[$dmChannelID[$var[u]]]
  1514. $if[$var[rating]==true]
  1515. $addButton[no;tkt_rtng-verybad-$var[guild];Very bad!;danger;no;;$var[dm_id]]
  1516. $addButton[no;tkt_rtng-bad-$var[guild];Bad!;danger;no;;$var[dm_id]]
  1517. $addButton[no;tkt_rtng-regular-$var[guild];Regular;primary;no;;$var[dm_id]]
  1518. $addButton[no;tkt_rtng-good-$var[guild];Good!;success;no;;$var[dm_id]]
  1519. $addButton[no;tkt_rtng-verygood-$var[guild];Very good!;success;no;;$var[dm_id]]
  1520. $else
  1521. $try
  1522. $addButton[no;$getBotInvite;Invite $username[$botID]!;link;no;;$var[dm_id]]
  1523. $catch
  1524. $addButton[no;$getBotInvite;Invite me!;link;no;;$var[dm_id]]
  1525. $endtry
  1526. $endif
  1527. $endtry
  1528. $async[bl]
  1529. $useChannel[$channelID]
  1530. $var[saved_id;$sendEmbedMessage[$channelID;;Closed & Saved;;This Ticket has been Closed & Saved by **$username[$authorID]#$discriminator[$authorID]**!
  1531. ```This Ticket won't be seen by the person that opened it anymore, only staffs, if you wish to open this ticket back just use the panel!```;$var[main_color];$serverName[$guildID];$serverIcon[$guildID];;;;;;yes]]
  1532.  
  1533. $addButton[no;tkt_close;Close Ticket;danger;no;$var[close_emoji];$var[saved_id]]
  1534. $addButton[no;tkt_pnel;Staff Panel;primary;no;$var[panel_emoji];$var[saved_id]]
  1535. $endasync
  1536. $optOff[$modifyChannel[$channelID;solved-$channelName[$channelID]]]
  1537. $editChannelPerms[$channelID;$var[u];-sendmessages;-readmessages]
  1538. $removeButtons
  1539. $title[Closed & Saved]
  1540. $description[> ☑️ Successfully **Closed & Saved** this ticket! You still can use the panel to perform other actions such as actually closing this ticket. ]
  1541. $color[$var[success_color]]
  1542. $ephemeral
  1543. $stop $c[s]
  1544. $endif
  1545. $if[$checkContains[$customID;tkt_rtng-]==true]
  1546. $defer
  1547. $if[$varExists[tickets2]==false]
  1548. $removeButtons
  1549. $try
  1550. $if[$userExists[$botOwnerID]==true]
  1551. $var[bot_dev;**$username[$botOwnerID]#$discriminator[$botOwnerID]** (The Bot Developer)]
  1552. $else
  1553. $var[bot_dev;the Bot Developer]
  1554. $endif
  1555. $catch
  1556. $var[bot_dev;the Bot Developer]
  1557. $endtry
  1558. $title[Error!]
  1559. $description[Thanks for rating, your rating **wasn't** sent anywhere since there has been an **error** trying to set your anonymous rate, please contact $var[bot_dev], and send them the following error message.
  1560. ```error: Missing variable "tickets2", this variable must be added in order to make the rating system work.```]
  1561. $color[$var[error_color]]
  1562. $stop
  1563. $endif
  1564. $textSplit[$customID;-]
  1565. $var[rate;$splitText[2]]
  1566. $var[guild;$splitText[3]]
  1567. $removeButtons
  1568. $if[$checkContains[$getServerVar[tickets2;$var[guild]];--]==false]
  1569. $setServerVar[tickets2;0--0--0--0--0;$var[guild]]
  1570. $endif
  1571. $textSplit[$getServerVar[tickets2;$var[guild]];--]
  1572. $if[$var[rate]==verybad]
  1573. $setServerVar[tickets2;$sum[0$splitText[1];1]--$splitText[2]--$splitText[3]--$splitText[4]--$splitText[5];$var[guild]]
  1574. $var[feedback_msg;$var[negative_rate]]
  1575. $endif
  1576. $if[$var[rate]==bad]
  1577. $setServerVar[tickets2;$splitText[1]--$sum[0$splitText[2];1]--$splitText[3]--$splitText[4]--$splitText[5];$var[guild]]
  1578. $var[feedback_msg;$var[negative_rate]]
  1579. $endif
  1580. $if[$var[rate]==regular]
  1581. $setServerVar[tickets2;$splitText[1]--$splitText[2]--$sum[0$splitText[3];1]--$splitText[4]--$splitText[5];$var[guild]]
  1582. $var[feedback_msg;$var[positive_rate]]
  1583. $endif
  1584. $if[$var[rate]==good]
  1585. $setServerVar[tickets2;$splitText[1]--$splitText[2]--$splitText[3]--$sum[0$splitText[4];1]--$splitText[5];$var[guild]]
  1586. $var[feedback_msg;$var[positive_rate]]
  1587. $endif
  1588. $if[$var[rate]==verygood]
  1589. $setServerVar[tickets2;$splitText[1]--$splitText[2]--$splitText[3]--$splitText[4]--$sum[0$splitText[5];1];$var[guild]]
  1590. $var[feedback_msg;$var[positive_rate]]
  1591. $endif
  1592. $title[Thank you!]
  1593. $description[$replaceText[$var[feedback_msg];{server};$serverName[$var[guild]];-1]]
  1594. $footer[$username[$botID]'s Ticket System]
  1595. $color[$var[neutral_color]]
  1596. $try
  1597. $addButton[no;$getBotInvite;Invite $username[$botID]!;link;no;]
  1598. $catch
  1599. $addButton[no;$getBotInvite;Invite me!;link;no;]
  1600. $endtry
  1601. $stop $c[s]
  1602. $endif
  1603. $suppressErrors
  1604. $c[Code by Berk#3506]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement