Brucord-Xloxn1296

Advance Add Role | Made By "Xloxn#4050" Idea By "Aidan328#4713"

Jun 23rd, 2022 (edited)
533
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 13.89 KB | None | 1 0
  1. Variable: rolestuff
  2. Value: (keep empty)
  3. ----------------------------------------------
  4. 1st Command
  5. Trigger: (prefix)create-role
  6. Scripting Language: BDscript 2
  7. ----------------------------------------------
  8. $nomention
  9. $var[x;]
  10. $if[$checkUserPerms[$authorID;manageroles]==false]
  11. $addField[$var[x] Action Denied!;You don’t have the **Manage Roles** permisson]
  12. $addTimestamp
  13. $color[#eb4346]
  14. $deleteIn[5s]
  15. $async[1]
  16. $replyIn[5s]
  17. $deletecommand
  18. $endasync
  19. $elseif[$checkUserPerms[$botID;manageroles]==false]
  20. $addField[$var[x] Action Denied!;I don’t have the **Manage Roles** permisson]
  21. $addTimestamp
  22. $color[#eb4346]
  23. $else
  24. $resetUserVar[rolestuff]
  25. $title[🎨 Role Creator]
  26. $description[• Start by clicking the “Create Role” button]
  27. $addField[More Info;
  28. • You can keep inputs empty, though you shouldn’t with the role’s name
  29. • For the permissons step, you can’t put permissons you don’t have
  30. ]
  31. $color[#2f3136]
  32. $deletecommand
  33. $addButton[no;createrole-$authorID;Create Role;secondary;no;🎨]
  34. $addButton[no;deletemessage-$authorID;Delete Message;secondary;no;🗑]
  35. $endif
  36.  
  37. ----------------------------------------------
  38. 2nd Command
  39. Trigger: $onInteraction
  40. Scripting Language: BDscript 2
  41. ----------------------------------------------
  42. $nomention
  43.  
  44. $var[x;]
  45.  
  46. $textSplit[$date;-]
  47. $var[month;$splitText[2]]
  48.  
  49. $if[$checkContains[$customID;createrole]==true]
  50. $textSplit[$customID;-]
  51.  
  52. $if[$and[$checkContains[$customID;createrole]==true;$splitText[2]!=$authorID]==true]
  53. $ephemeral
  54. $removeButtons
  55. $addField[$var[x] Action Denied!;This button isn’t for you]
  56. $addTimestamp
  57. $color[#eb4346]
  58. $else
  59.  
  60. $if[$checkUserPerms[$authorID;manageroles]==true]
  61. $newModal[rolebuilder;Role Builder]
  62. $addTextInput[name;short;Name;;100;yes;;The role’s name.]
  63. $addTextInput[color;short;Color;;6;no;;The role’s color]
  64. $addTextInput[display;short;Display;;3;no;;Yes / No, Display the role members separately from online members?]
  65. $addTextInput[mentionable;short;Mentionable;;3;no;;Yes / No, Allow anyone to @mention this role?]
  66. $else
  67. $ephemeral
  68. $removeButtons
  69. $addField[$var[x] Action Denied;You don’t reach the requirments for this step.]
  70. $color[#eb4346]
  71. $footer[© $username[$botID] Development $var[month]/$day/$year]
  72. $endif
  73. $endif
  74. $endif
  75.  
  76. $if[$customID==rolebuilder]
  77.  
  78. $if[$input[display]==]
  79. $var[display;no]
  80. $elseif[$checkContains[$toLowercase[$input[display]];no]==true]
  81. $var[display;no]
  82. $elseif[$checkContains[$toLowercase[$input[display]];yes]==true]
  83. $var[display;yes]
  84. $else
  85. $var[display;no]
  86. $endif
  87.  
  88. $if[$input[mentionable]==]
  89. $var[mentionable;no]
  90. $elseif[$checkContains[$toLowercase[$input[mentionable]];no]==true]
  91. $var[mentionable;no]
  92. $elseif[$checkContains[$toLowercase[$input[mentionable]];yes]==true]
  93. $var[mentionable;yes]
  94. $else
  95. $var[mentionable;no]
  96. $endif
  97.  
  98. $if[$input[color]!=]
  99. $createRole[$input[name];$input[color];$var[display];$var[mentionable]]
  100. $else
  101. $createRole[$input[name];0;$var[display];$var[mentionable]]
  102. $endif
  103.  
  104. $embedSuppressErrors[$var[x] Action Denied;You don’t reach the requirments for this step.;#eb4346;;© $username[$botID] Development $var[month]/$day/$year;]
  105. $title[🎨 Role Creation: Permissons]
  106. $description[What permissons you want <@&$findRole[$input[name]]> to have?]
  107. $color[#3897D9]
  108. $footer[You can only put the permissons you have!]
  109. $newSelectMenu[perms;0;12;Permissons;]
  110. $if[$checkUserPerms[$authorID;admin]==true]
  111. $addSelectMenuOption[perms;Admin;admin-$authorID-;;no;;]
  112. $endif
  113. $if[$checkUserPerms[$authorID;addreactions]==true]
  114. $addSelectMenuOption[perms;Add Reactions;addreactions-$authorID-;;no;]
  115. $endif
  116. $if[$checkUserPerms[$authorID;changenicknames]==true]
  117. $addSelectMenuOption[perms;Change Nicknames;changenicknames-$authorID-;;no;]
  118. $endif
  119. $if[$checkUserPerms[$authorID;managechannels]==true]
  120. $addSelectMenuOption[perms;Manage Channels;managechannels-$authorID-;;no;;]
  121. $endif
  122. $if[$checkUserPerms[$authorID;managemessages]==true]
  123. $addSelectMenuOption[perms;Manage Messages;managemessages-$authorID-;;no;;]
  124. $endif
  125. $if[$checkUserPerms[$authorID;managenicknames]==true]
  126. $addSelectMenuOption[perms;Manage Nicknames;managenicknames-$authorID-;;no;]
  127. $endif
  128. $if[$checkUserPerms[$authorID;manageroles]==true]
  129. $addSelectMenuOption[perms;Manage Roles;manageroles-$authorID-;;no;]
  130. $endif
  131. $if[$checkUserPerms[$authorID;manageserver]==true]
  132. $addSelectMenuOption[perms;Manage Server;manageserver-$authorID-;;no;]
  133. $endif
  134. $if[$checkUserPerms[$authorID;mentioneveryone]==true]
  135. $addSelectMenuOption[perms;Mention Everyone;mentioneveryone-$authorID-;;no;]
  136. $endif
  137. $if[$checkUserPerms[$authorID;moderatemembers]==true]
  138. $addSelectMenuOption[perms;Moderate Members;moderatemembers-$authorID-;;no;]
  139. $endif
  140. $if[$checkUserPerms[$authorID;readmessages]==true]
  141. $addSelectMenuOption[perms;Read Messages;readmessages-$authorID-;;no;]
  142. $endif
  143. $if[$checkUserPerms[$authorID;readmessagehistory]==true]
  144. $addSelectMenuOption[perms;Read Message History;readmessagehistory-$authorID-;;no;]
  145. $endif
  146.  
  147. $deleteMessage[$channelID;$messageID]
  148. $endif  
  149.  
  150. $if[$customID==deletemessage-$authorID]
  151. $if[$checkUserPerms[$botID;managemessages]==true]
  152. $deleteMessage[$channelID;$messageID]
  153. $else
  154. $endif
  155. $endif
  156. ----------------------------------------------
  157. 3rd Command
  158. Trigger: $onInteraction[perms]
  159. Scripting Language: BDscript 2
  160. ----------------------------------------------
  161.  
  162. $nomention
  163. $var[x;]
  164.  
  165. $var[role;$replaceText[$replaceText[$getEmbedData[$channelID;$messageID;1;description];What permissons you want;;-1];to have?;;-1]]
  166. $var[ID;$trimSpace[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$var[role];<;;-1];@;;-1];>;;-1];&;;-1];I’ve given;;-1]]]
  167. $var[roleID;$var[ID]]
  168.  
  169. $if[$checkContains[$message;admin-$authorID]==true]
  170. $textSplit[$message;-]
  171. $if[$splitText[2]!=$authorID]
  172. $ephemeral
  173. $removeButtons
  174. $addField[$var[x] Action Denied!;This button isn’t for you]
  175. $addTimestamp
  176. $color[#eb4346]
  177. $else
  178. $if[$getUserVar[rolestuff]==]
  179. $setUserVar[rolestuff;Admin] $else
  180. $setUserVar[rolestuff;$getUserVar[rolestuff], Admin]
  181. $endif
  182. $modifyRolePerms[$var[ID];admin]
  183. $endif
  184. $endif
  185.  
  186. $if[$checkContains[$message;addreactions-$authorID]==true]
  187. $textSplit[$message;-]
  188. $if[$splitText[2]!=$authorID]
  189. $ephemeral
  190. $removeButtons
  191. $addField[$var[x] Action Denied!;This button isn’t for you]
  192. $addTimestamp
  193. $color[#eb4346]
  194. $else
  195. $if[$getUserVar[rolestuff]==]
  196. $setUserVar[rolestuff;Add Reactions] $else
  197. $setUserVar[rolestuff;$getUserVar[rolestuff], Add Reactions]
  198. $endif
  199. $modifyRolePerms[$var[ID];admin]
  200. $endif
  201. $endif
  202.  
  203. $if[$checkContains[$message;changenicknames-$authorID]==true]
  204. $textSplit[$message;-]
  205. $if[$splitText[2]!=$authorID]
  206. $ephemeral
  207. $removeButtons
  208. $addField[$var[x] Action Denied!;This button isn’t for you]
  209. $addTimestamp
  210. $color[#eb4346]
  211. $else
  212. $if[$getUserVar[rolestuff]==]
  213. $setUserVar[rolestuff;Change Nicknames ] $else
  214. $setUserVar[rolestuff;$getUserVar[rolestuff], Change Nicknames]
  215. $endif
  216. $modifyRolePerms[$var[ID];changenicknames]
  217. $endif
  218. $endif
  219.  
  220. $if[$checkContains[$message;managechannels-$authorID]==true]
  221. $textSplit[$message;-]
  222. $if[$splitText[2]!=$authorID]
  223. $ephemeral
  224. $removeButtons
  225. $addField[$var[x] Action Denied!;This button isn’t for you]
  226. $addTimestamp
  227. $color[#eb4346]
  228. $else
  229. $if[$getUserVar[rolestuff]==]
  230. $setUserVar[rolestuff;Manage Channels] $else
  231. $setUserVar[rolestuff;$getUserVar[rolestuff], Manage Channels]
  232. $endif
  233. $modifyRolePerms[$var[ID];managechannels]
  234. $endif
  235. $endif
  236.  
  237. $if[$checkContains[$message;managemessages-$authorID]==true]
  238. $textSplit[$message;-]
  239. $if[$splitText[2]!=$authorID]
  240. $ephemeral
  241. $removeButtons
  242. $addField[$var[x] Action Denied!;This button isn’t for you]
  243. $addTimestamp
  244. $color[#eb4346]
  245. $else
  246. $if[$getUserVar[rolestuff]==]
  247. $setUserVar[rolestuff;Manage Messages] $else
  248. $setUserVar[rolestuff;$getUserVar[rolestuff], Manage Messages]
  249. $endif
  250. $modifyRolePerms[$var[ID];managemessages]
  251. $endif
  252. $endif
  253.  
  254. $if[$checkContains[$message;managenicknames-$authorID]==true]
  255. $textSplit[$message;-]
  256. $if[$splitText[2]!=$authorID]
  257. $ephemeral
  258. $removeButtons
  259. $addField[$var[x] Action Denied!;This button isn’t for you]
  260. $addTimestamp
  261. $color[#eb4346]
  262. $else
  263. $if[$getUserVar[rolestuff]==]
  264. $setUserVar[rolestuff;Add Reactions] $else
  265. $setUserVar[rolestuff;$getUserVar[rolestuff], Manage Nicknames]
  266. $endif
  267. $modifyRolePerms[$var[ID];managenicknames]
  268. $endif
  269. $endif
  270.  
  271. $if[$checkContains[$message;manageroles-$authorID]==true]
  272. $textSplit[$message;-]
  273. $if[$splitText[2]!=$authorID]
  274. $ephemeral
  275. $removeButtons
  276. $addField[$var[x] Action Denied!;This button isn’t for you]
  277. $addTimestamp
  278. $color[#eb4346]
  279. $else
  280. $if[$getUserVar[rolestuff]==]
  281. $setUserVar[rolestuff;Manage Roles] $else
  282. $setUserVar[rolestuff;$getUserVar[rolestuff], Manage Roles]
  283. $endif
  284. $modifyRolePerms[$var[ID];manageroles]
  285. $endif
  286. $endif
  287.  
  288. $if[$checkContains[$message;manageserver-$authorID]==true]
  289. $textSplit[$message;-]
  290. $if[$splitText[2]!=$authorID]
  291. $ephemeral
  292. $removeButtons
  293. $addField[$var[x] Action Denied!;This button isn’t for you]
  294. $addTimestamp
  295. $color[#eb4346]
  296. $else
  297. $if[$getUserVar[rolestuff]==]
  298. $setUserVar[rolestuff;Manage Server] $else
  299. $setUserVar[rolestuff;$getUserVar[rolestuff], Manage Server]
  300. $endif
  301. $modifyRolePerms[$var[ID];manageserver]
  302. $endif
  303. $endif
  304.  
  305. $if[$checkContains[$message;mentioneveryone-$authorID]==true]
  306. $textSplit[$message;-]
  307. $if[$splitText[2]!=$authorID]
  308. $ephemeral
  309. $removeButtons
  310. $addField[$var[x] Action Denied!;This button isn’t for you]
  311. $addTimestamp
  312. $color[#eb4346]
  313. $else
  314. $if[$getUserVar[rolestuff]==]
  315. $setUserVar[rolestuff;Mention Everyone] $else
  316. $setUserVar[rolestuff;$getUserVar[rolestuff], Mention Everyone]
  317. $endif
  318. $modifyRolePerms[$var[ID];mentioneveryone]
  319. $endif
  320. $endif
  321.  
  322. $if[$checkContains[$message;moderatemembers-$authorID]==true]
  323. $textSplit[$message;-]
  324. $if[$splitText[2]!=$authorID]
  325. $ephemeral
  326. $removeButtons
  327. $addField[$var[x] Action Denied!;This button isn’t for you]
  328. $addTimestamp
  329. $color[#eb4346]
  330. $else
  331. $if[$getUserVar[rolestuff]==]
  332. $setUserVar[rolestuff;Moderate Members] $else
  333. $setUserVar[rolestuff;$getUserVar[rolestuff], Moderate Members]
  334. $endif
  335. $modifyRolePerms[$var[ID];moderatemembers]
  336. $endif
  337. $endif
  338.  
  339. $if[$checkContains[$message;readmessages-$authorID]==true]
  340. $textSplit[$message;-]
  341. $if[$splitText[2]!=$authorID]
  342. $ephemeral
  343. $removeButtons
  344. $addField[$var[x] Action Denied!;This button isn’t for you]
  345. $addTimestamp
  346. $color[#eb4346]
  347. $else
  348. $if[$getUserVar[rolestuff]==]
  349. $setUserVar[rolestuff;Read Messages] $else
  350. $setUserVar[rolestuff;$getUserVar[rolestuff], Read Messages]
  351. $endif
  352. $modifyRolePerms[$var[ID];readmessages]
  353. $endif
  354. $endif
  355.  
  356. $if[$checkContains[$message;readmessagehistory-$authorID]==true]
  357. $textSplit[$message;-]
  358. $if[$splitText[2]!=$authorID]
  359. $ephemeral
  360. $removeButtons
  361. $addField[$var[x] Action Denied!;This button isn’t for you]
  362. $addTimestamp
  363. $color[#eb4346]
  364. $else
  365. $if[$getUserVar[rolestuff]==]
  366. $setUserVar[rolestuff;Read Message History] $else
  367. $setUserVar[rolestuff;$getUserVar[rolestuff], Read Message History]
  368. $endif
  369. $modifyRolePerms[$var[ID];readmessagehistory]
  370. $endif
  371. $endif
  372.  
  373.  
  374.  
  375. $var[rolemsgID;$sendEmbedMessage[$channelID;;🎨 Role Creation: Members;;Who do you want to give <@&$var[ID]> to?
  376. Type `skip` if you wish to skip this step!;#ed6360;;;;;;;no;yes]]
  377. $if[$getUserVar[rolestuff]!=]
  378. $setUserVar[rolestuff;$var[rolemsgID] | $getUserVar[rolestuff]]
  379. $textSplit[$getUserVar[rolestuff];|]
  380. $if[$isNumber[$splitText[2]]==true]
  381. $setUserVar[rolestuff;$var[rolemsgID] | *No Permissions!*]
  382. $endif
  383. $else
  384. $setUserVar[rolestuff;$var[rolemsgID] | *No Permissions!*]
  385. $endif
  386. $removeComponent[perms]
  387. $awaitFunc[rolemembers;$authorID]
  388. $deleteMessage[$channelID;$messageID]
  389.  
  390. ----------------------------------------------
  391. 4th Command
  392. Trigger: $awaitedCommand[rolemembers;]
  393. Scripting Language: BDscript 2
  394. ----------------------------------------------
  395.  
  396. $nomention
  397.  
  398. $var[x;]
  399.  
  400. $allowMention
  401. $if[$checkContains[$toLowercase[$message];skip]==false]
  402. $textSplit[$getUserVar[rolestuff];|]
  403. $var[ID;$trimSpace[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$getEmbedData[$channelID;$splitText[1];1;description];Who do you want to give;;-1];to?;;-1];<@&;;-1];>;;-1];Type `skip` if you wish to skip this step!;;-1]]]
  404. $var[perms;$splitText[2]]
  405. $var[msgID;$splitText[1]]
  406. $if[$mentioned[1]!=]
  407. $roleGrant[$mentioned[1];+$var[ID]]
  408. $else
  409. $addField[$var[x] Action Denied!;You didn’t mention anyone]
  410. $color[#eb4346]
  411. $addTimestamp
  412. $deleteIn[5s]
  413. $endif
  414. $if[$mentioned[1]!=]
  415. $if[$mentioned[2]!=]
  416. $roleGrant[$mentioned[2];+$var[ID]]
  417. $endif
  418. $if[$mentioned[3]!=]
  419. $roleGrant[$mentioned[3];+$var[ID]]
  420. $endif
  421. $if[$mentioned[4]!=]
  422. $roleGrant[$mentioned[4];+$var[ID]]
  423. $endif
  424. $if[$mentioned[5]!=]
  425. $roleGrant[$mentioned[5];+$var[ID]]
  426. $endif
  427. $if[$mentioned[6]!=]
  428. $roleGrant[$mentioned[6];+$var[ID]]
  429. $endif
  430. $if[$mentioned[7]!=]
  431. $roleGrant[$mentioned[7];+$var[ID]]
  432. $endif
  433. $if[$mentioned[8]!=]
  434. $roleGrant[$mentioned[8];+$var[ID]]
  435. $endif
  436. $if[$mentioned[9]!=]
  437. $roleGrant[$mentioned[9];+$var[ID]]
  438. $endif
  439. $if[$mentioned[10]!=]
  440. $roleGrant[$mentioned[10];+$var[ID]]
  441. $endif
  442. $allowMention
  443.  
  444. $deletecommand
  445. $deleteMessage[$channelID;$var[msgID]]
  446. $title[🎨 Role Creation: Finished]
  447. $addField[Role;<@&$var[ID]> `[$roleName[$var[ID]]\]`;no]
  448. $addField[Permissons;$var[perms];no]
  449. $addField[Members;$message;no]
  450. $resetUserVar[rolestuff]
  451. $color[#2f3136]
  452. $endif
  453. $endif
  454. $endif
  455. $if[$checkContains[$toLowercase[$message];skip]==true]
  456.  
  457. $textSplit[$getUserVar[rolestuff];|]
  458. $var[ID;$trimSpace[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$getEmbedData[$channelID;$splitText[1];1;description];Who do you want to give;;-1];to?;;-1];<@&;;-1];>;;-1];Type `skip` if you wish to skip this step!;;1]]]
  459. $var[perms;$splitText[2]]
  460. $var[msgID;$splitText[1]]
  461.  
  462. $title[🎨 Role Creation: Finished]
  463. $addField[Role;<@&$var[ID]> `[$roleName[$var[ID]]\]`;no]
  464. $addField[Permissons;$var[perms];no]
  465. $addField[Members;*No Members!*;no]
  466. $resetUserVar[rolestuff]
  467. $color[#2f3136]
  468. $endif
  469.  
  470. ----------------------------------------------
  471.  
  472. You've reached the end!
  473.  
Add Comment
Please, Sign In to add comment