Advertisement
Aouchan

/role-members

Aug 23rd, 2024 (edited)
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.32 KB | Source Code | 0 0
  1. $nomention
  2. $onlyIf[$isSlash==true;]
  3.  
  4. $c[ Visit -> https://dadocs.rickyjs.xyz/ for more information about API key ]
  5.  
  6. $try
  7. $onlyIf[$guildID!=;]
  8. $catch
  9. $ephemeral
  10. You can't use this command in DMs!
  11. $stop
  12. $endtry
  13.  
  14. $try
  15. $onlyIf[$message[role]!=$guildID;]
  16. $catch
  17. $ephemeral
  18. Try another role other than `@everyone`
  19. $stop
  20. $endtry
  21.  
  22. $defer
  23.  
  24. $var[guild-members-endpoint.version;release]
  25.  
  26. $var[api-key;$getVar[ApiKey]]
  27. $var[bot-token;$getVar[BotToken]]
  28.  
  29. $var[tick.emoji;✅]
  30. $var[cross.emoji;❌]
  31. $var[loading.emoji;💫]
  32. $var[page.emoji;📝]
  33.  
  34. $var[guild-id;$guildID]
  35. $var[author-id;$authorID]
  36.  
  37. $var[first-page.arrow;<:Pixelated_FirstArrow:1193452503589716078>]
  38. $var[last-page.arrow;<:Pixelated_LastArrow:1193452401831710720>]
  39. $var[next-page.arrow;<:Pixelated_NextArrow:1193452428230672435>]
  40. $var[prev-page.arrow;<:Pixelated_PrevArrow:1193452525832126464>]
  41.  
  42. $var[arrow.buttons.style;secondary]
  43. $var[page.button.style;primary]
  44.  
  45. $var[\n;$url[decode;%0A]]
  46. $var[\n.space;$url[decode;%0A+]]
  47.  
  48. $httpAddHeader[apikey;$var[api-key]]
  49. $httpAddHeader[bot-token;$var[bot-token]]
  50. $httpAddHeader[guild-id;$var[guild-id]]
  51. $httpAddHeader[exclude;nick,user<username,global_name>]
  52. $httpGet[https://bdfddata.rickyjs.xyz/$var[guild-members-endpoint.version]/guild/members]
  53.  
  54. $var[role.id;$message[role]]
  55. $var[role.color;$getRoleColor[$var[role.id]]]
  56.  
  57. $async[fetch_role_icon]
  58. $httpAddHeader[role;$var[role.id]]
  59. $httpGet[https://bdfddata.rickyjs.xyz/release/guild/roles]
  60. $jsonParse[$httpResult]
  61.  
  62. $var[role.icon;$json[details;icon]]
  63. $var[isBoosterRole;$jsonExists[details;tags;premium_subscriber]]
  64. $endasync $await[fetch_role_icon]
  65.  
  66. $textSplit[$httpResult;$var[role.id]]
  67.  
  68. $var[role.members.count;$sub[$getTextSplitLength;1]]
  69.  
  70. $if[$var[role.members.count]==0]
  71. $description[No members found in <@&$var[role.id]> role]
  72. $color[$var[role.color]]
  73. $else
  74. $async[page_math]
  75. $enableDecimals[true]
  76. $var[div;$divide[$var[role.members.count];10]]
  77.  
  78. $if[$checkContains[$var[div];.]==true]
  79. $textSplit[$var[div];.]
  80. $var[total.pages;$sum[$splitText[1];1]]
  81. $else
  82. $var[total.pages;$var[div]]
  83. $endif
  84. $endasync $await[page_math]
  85.  
  86. $var[x;2]
  87. $var[q;0]
  88.  
  89. $if[$var[isBoosterRole]==true]
  90. $var[code;%{DOL}%async[boost-since-%{DOL}%var[x\]\]%{DOL}%textSplit[%{DOL}%splitText[%{DOL}%sub[%{DOL}%var[x\]\;1\]\]\;"premium_since":"\]%{DOL}%textSplit[%{DOL}%splitText[2\]\;"\]%{DOL}%splitText[1\]%{DOL}%endasync%{DOL}%async[%{DOL}%var[x\]\]%{DOL}%textSplit[%{DOL}%cropText[%{DOL}%splitText[%{DOL}%var[x\]\]\;2000\;\]\;"user":{"id":"\]%{DOL}%textSplit[%{DOL}%cropText[%{DOL}%splitText[2\]\;100\;\]\;"\]%{DOL}%splitText[1\]%{DOL}%endasync%{DOL}%if[%{DOL}%await[%{DOL}%var[x\]\]!=\]%{DOL}%if[%{DOL}%await[boost-since-%{DOL}%var[x\]\]!=\]%{DOL}%jsonSetString[%{DOL}%await[%{DOL}%var[x\]\]-timestamps\;boost\;%{DOL}%await[boost-since-%{DOL}%var[x\]\]\]%{DOL}%endif%{DOL}%jsonArrayAppend[role-members\;%{DOL}%await[%{DOL}%var[x\]\]\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[x\;%{DOL}%calculate[%{DOL}%var[x\]+1\]\]]
  91. $else
  92. $var[code;%{DOL}%async[%{DOL}%var[x\]\]%{DOL}%textSplit[%{DOL}%cropText[%{DOL}%splitText[%{DOL}%var[x\]\]\;2000\;\]\;"user":{"id":"\]%{DOL}%textSplit[%{DOL}%cropText[%{DOL}%splitText[2\]\;100\;\]\;"\]%{DOL}%splitText[1\]%{DOL}%endasync%{DOL}%if[%{DOL}%await[%{DOL}%var[x\]\]!=\]%{DOL}%jsonArrayAppend[role-members\;%{DOL}%await[%{DOL}%var[x\]\]\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[x\;%{DOL}%calculate[%{DOL}%var[x\]+1\]\]]
  93. $endif
  94.  
  95. $eval[$repeatMessage[10;$var[code]]]
  96.  
  97. $if[$var[isBoosterRole]==true]
  98. $var[show.members;$eval[1. <@$jsonJoinArray[role-members;> `(@%{DOL}%username[%{DOL}%json[role-members\;%{DOL}%var[q\]\]\])` %{DOL}%if[%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]!=\]%{DOL}%var[\n.space\]- -# **Boosted:** <t:%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]> (<t:%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]:R>)%{DOL}%endif %{DOL}%var[q\;%{DOL}%calculate[%{DOL}%var[q\]+1\]\]%{DOL}%var[\n\]- <@]> `(@%{DOL}%username[%{DOL}%json[role-members\;%{DOL}%var[q\]\]\])` %{DOL}%if[%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]!=\]%{DOL}%var[\n.space\]- -# **Boosted:** <t:%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]> (<t:%{DOL}%json[%{DOL}%json[role-members\;%{DOL}%var[q\]\]-timestamps\;boost\]:R>)%{DOL}%endif]]
  99. $else
  100. $var[show.members;$eval[1. <@$jsonJoinArray[role-members;> `(@%{DOL}%username[%{DOL}%json[role-members\;%{DOL}%var[q\]\]\])` %{DOL}%var[q\;%{DOL}%calculate[%{DOL}%var[q\]+1\]\]%{DOL}%var[\n\]- <@]> `(@%{DOL}%username[%{DOL}%json[role-members\;%{DOL}%var[q\]\]\])`]]
  101. $endif
  102.  
  103. $description[## Role Members of <@&$var[role.id]>$var[\n]-# There are $var[role.members.count] members;1]
  104. $thumbnail[$var[role.icon];1]
  105. $footer[Role ID: $var[role.id];1]
  106. $description[$var[show.members];2]
  107. $footer[Page 1/$var[total.pages];2]
  108.  
  109. $color[$var[role.color];1]
  110. $color[$var[role.color];2]
  111.  
  112. $addButton[no;roleMembers-$var[author-id]-$var[role.id]-FirstPage;;$var[arrow.buttons.style];true;$var[first-page.arrow]]
  113. $addButton[no;roleMembers-$var[author-id]-$var[role.id]-PrevPage;;$var[arrow.buttons.style];true;$var[prev-page.arrow]]
  114. $addButton[no;roleMembers-$var[author-id]-$var[role.id]-NextPage;;$var[arrow.buttons.style];$checkCondition[$var[total.pages]==1];$var[next-page.arrow]]
  115. $addButton[no;roleMembers-$var[author-id]-$var[role.id]-LastPage;;$var[arrow.buttons.style];$checkCondition[$var[total.pages]==1];$var[last-page.arrow]]
  116. $addButton[no;roleMembers.pageModal-$var[author-id]-$var[role.id];;$var[page.button.style];$checkCondition[$var[total.pages]==1];$var[page.emoji]]
  117.  
  118. $var[i;0]
  119. $var[code;%{DOL}%addSelectMenuOption[RoleMembersList.Menu\;%{DOL}%sum[%{DOL}%var[i\]\;1\]. %{DOL}%username[%{DOL}%json[role-members\;%{DOL}%var[i\]\]\]\;roleMemberInfo-%{DOL}%authorID-%{DOL}%json[role-members\;%{DOL}%var[i\]\]-%{DOL}%var[role.id\]\;\;\;\;\]%{DOL}%var[i\;%{DOL}%calculate[%{DOL}%var[i\] + 1\]\]]
  120.  
  121. $newSelectMenu[RoleMembersList.Menu;1;1;Role Members 🌸 (Page 1)]
  122. $eval[$repeatMessage[$jsonArrayCount[role-members];$var[code]]]
  123. $endif
  124.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement