Dreamer_1314

Akinator Code

Jul 21st, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. Code 1
  2. --------------------------------------------------------------------------------
  3. Trigger : $onInteraction
  4. Language : BDScript 2
  5. Code :
  6. "
  7.  
  8.  
  9.  
  10. $nomention
  11.  
  12. $if[.$isSlash.$customID.==.true..]
  13. $onlyAdmin[Only admin can create rolemenu!]
  14. $c[Create Embed]
  15. $try
  16. $var[msgid;$sendEmbedMessage[$channelID;;$message[title];;$message[description];$replaceText[$replaceText[$isValidHex[$message[color]];true;$message[color]];false;ff8888];;;$message[footer];;$message[thumbnail];$message[image];no;yes]]
  17. $catch
  18. $var[msgid;$sendEmbedMessage[$channelID;;Get some roles from the menu below.;;$message[description];$replaceText[$replaceText[$isValidHex[$message[color]];true;$message[color]];false;ff8888];;;$message[footer];;$message[thumbnail];$message[image];no;yes]]
  19. $endtry
  20. $addButton[no;rolemenu•add•$authorID;Add Options;primary;no;🏷️;$var[msgid]]
  21. $addButton[no;rolemenu•conf•$authorID;Confirm;success;no;📑;$var[msgid]]
  22. $ephemeral
  23. ✏️ **RoleMenu created.** Use button to add options.
  24. ` -Code by Rajat#1004 `
  25.  
  26. $else
  27.  
  28. $onlyIf[$checkContains[$customID;rolemenu;roleisgay]==true;]
  29. $textSplit[$customID;•]
  30.  
  31. $c[Add options to the menu]
  32. $if[$splitText[2]•$splitText[3]==add•$authorID]
  33. $newModal[rolemenu•newrole•$messageID;Add Role Options]
  34. $addTextInput[name;short;Option Name;;;yes;;Get This Role]
  35. $addTextInput[role;short;Role ID/Name;;;yes;;ID/Name of the role.]
  36. $addTextInput[emo;short;Add Emoji;;;no;;🙂 or <:emoji:1234567890>]
  37. $addTextInput[req;short;Require Role;;;no;;ID/Name of the requirement role.]
  38. $addTextInput[bl;short;Blacklisted Role;;;no;;ID/Name of the blacklisted role.]
  39. $endif
  40.  
  41. $if[$splitText[2]==newrole]
  42. $onlyIf[$roleExists[$findRole[$input[role]]]==true;❗ Role with Name/ID ` $input[role] ` doesn't exist!]
  43. $ephemeral
  44. $removeButtons
  45. $removeComponent[roleisgay]
  46. $if[$rolePosition[$highestRole[$botID]]<$rolePosition[$findRole[$input[role]]]]
  47. $if[$input[req]!=]
  48. $onlyIf[$roleExists[$findRole[$input[req]]]==true;❗ Requirement Role with Name/ID ` $input[req] ` doesn't exist!]
  49. $endif
  50. $if[$input[bl]!=]
  51. $onlyIf[$roleExists[$findRole[$input[bl]]]==true;❗ Blacklisted Role with Name/ID ` $input[bl] ` doesn't exist!]
  52. $endif
  53. $try
  54. $addSelectMenuOption[roleisgay;$input[name];$findRole[$input[role]].$findRole[$input[req]].$findRole[$input[bl]];@$roleName[$findRole[$input[role]]]$if[$input[req]!=] (ℹ️ @$roleName[$findRole[$input[req]]])$endif$if[$input[bl]!=] (❌ @$roleName[$findRole[$input[bl]]])$endif;no;$input[emo];$splitText[3]]
  55. $catch
  56. $newSelectMenu[roleisgay;1;1;Get Roles;$splitText[3]]
  57. $addSelectMenuOption[roleisgay;Click to Add/Remove roles;mytrashcan;ℹ️ : Required Role, ❌ : Blacklisted Role;no;;$splitText[3]]
  58. $addSelectMenuOption[roleisgay;$input[name];$findRole[$input[role]].$findRole[$input[req]].$findRole[$input[bl]];@$roleName[$findRole[$input[role]]]$if[$input[req]!=] (ℹ️ @$roleName[$findRole[$input[req]]])$endif$if[$input[bl]!=] (❌ @$roleName[$findRole[$input[bl]]])$endif;no;$input[emo];$splitText[3]]
  59. $endtry
  60. ✅ Role <@&$findRole[$input[role]]> added to the options.
  61. $else
  62. ❗ **Discord's Military Hierarchy returned an error!** The role <@&$findRole[$input[role]]> should be below Bot's highest role <@&$highestRole[$botID]> for the bot to be able to assign this role!
  63. $endif
  64. $endif
  65.  
  66.  
  67. $c[Buttons are gay]
  68. $if[$splitText[2]•$splitText[3]==conf•$authorID]
  69. $async[butt]
  70. $removeButtons[$messageID]
  71. $endasync
  72. $removeButtons
  73. $removeComponent[roleisgay]
  74. $ephemeral
  75. 🎆 The rolemenu is created successfully.
  76. $endif
  77.  
  78.  
  79. $c[Get/Remove Role]
  80. $if[$customID==roleisgay]
  81. $onlyIf[$message!=mytrashcan;]
  82. $textSplit[$message;.]
  83. $color[$getRoleColor[$splitText[1]]]
  84. $removeComponent[$customID]
  85. $removeButtons
  86. $ephemeral
  87. $if[$hasRole[$authorID;$splitText[1]]==false]
  88. $if[$splitText[3]!=]
  89. $if[$hasRole[$authorID;$splitText[3]]==true]
  90. $description[**⚠️ Access Denied!** You have a role <@&$splitText[3]> which can not access <@&$splitText[1]>!]
  91. $stop
  92. $endif
  93. $endif
  94. $try
  95. $if[$splitText[2]!=]
  96. $if[$hasRole[$authorID;$splitText[2]]==false]
  97. $description[**❓ Requirement Role Missing** : You need to have <@&$splitText[2]> to access <@&$splitText[1]>!]
  98. $stop
  99. $endif
  100. $endif
  101. $endtry
  102. $giveRole[$authorID;$splitText[1]]
  103. $description[**✅ Role <@&$splitText[1]> added successfully.**]
  104. $image[https://singlecolorimage.com/get/$getRoleColor[$splitText[1]]/1000x8]
  105. $else
  106. $takeRole[$authorID;$splitText[1]]
  107. $description[**❌ Role <@&$splitText[1]> removed successfully.**]
  108. $endif
  109. $endif
  110. $endif
  111.  
Advertisement
Add Comment
Please, Sign In to add comment