Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Trigger: $onInteraction
- $nomention
- $botListHide
- $textSplit[$customID;-]
- $if[$splitText[1]==rl]
- $if[$splitText[2]==$authorID]
- $if[$splitText[3]==customPageModal]
- $newModal[roleList-$authorID-selectpageRL;Server Roles list]
- $addTextInput[rl.num;short;Page Number;1;2;true]
- $endif
- $else
- $ephemeral
- $removeAllComponents
- not your button!
- $endif
- $endif
- $if[$splitText[1]==roleList]
- $if[$splitText[2]==$authorID]
- $try
- $async[math]
- $textSplit[$replaceText[$getEmbedData[$channelID;$messageID;1;footer];Page;];/]
- $var[currentPage;$splitText[1]]
- $var[rc;$sub[$roleCount;1]]
- $enableDecimals[true]
- $var[div;$divide[$var[rc];10]]
- $if[$checkContains[$var[div];.]==true]
- $textSplit[$var[div];.]
- $var[tpg;$sum[1;$splitText[1]]]
- $else
- $var[tpg;$var[div]]
- $endif
- $endasync $await[math]
- $catch
- $ephemeral
- $removeAllComponents
- There was an error, you might have to run this command again
- $stop
- $endtry
- $var[foo;$getEmbedData[$channelID;$messageID;1;footer]]
- $var[col;$getEmbedData[$channelID;$messageID;1;color]]
- $var[ti;$getEmbedData[$channelID;$messageID;1;title]]
- $if[$splitText[3]==backmenu]
- $var[max_roles;$multi[$sub[$var[currentPage];1];10]]
- $var[start_role;$sub[$var[max_roles];9]]
- $var[current_page;$sub[$var[currentPage];1]]
- $editMessage[$channelID;$messageID;;$var[ti];*Fetching Previous Page...*;$var[col];$var[foo]]
- $elseif[$splitText[3]==nextmenu]
- $var[max_roles;$multi[$sum[$var[currentPage];1];10]]
- $var[start_role;$sub[$var[max_roles];9]]
- $var[current_page;$sum[$var[currentPage];1]]
- $editMessage[$channelID;$messageID;;$var[ti];*Fetching Next Page...*;$var[col];$var[foo]]
- $elseif[$splitText[3]==frontmenu]
- $var[max_roles;$multi[1;10]]
- $var[start_role;$sub[$var[max_roles];9]]
- $var[current_page;1]
- $editMessage[$channelID;$messageID;;$var[ti];*Fetching First Page...*;$var[col];$var[foo]]
- $elseif[$splitText[3]==lastmenu]
- $var[max_roles;$multi[$var[tpg];10]]
- $var[start_role;$sub[$var[max_roles];9]]
- $var[current_page;$var[tpg]]
- $editMessage[$channelID;$messageID;;$var[ti];*Fetching Last Page...*;$var[col];$var[foo]]
- $elseif[$splitText[3]==selectpageRL]
- $if[$isNumber[$input[rl.num]]==false]
- $ephemeral
- $removeAllComponents
- Please input a valid number
- $stop
- $endif
- $if[$checkContains[$input[rl.num];.]==true]
- $ephemeral
- $removeAllComponents
- You can not put floats/decimals in your number!
- $stop
- $endif
- $if[$input[rl.num]<=0]
- $ephemeral
- $removeAllComponents
- You can not put `0` or a negative number
- $stop
- $endif
- $if[$input[rl.num]>$var[tpg]]
- $ephemeral
- $removeAllComponents
- Page `$input[rl.num]` does not exist!
- $stop
- $endif
- $var[max_roles;$multi[$input[rl.num];10]]
- $var[start_role;$sub[$var[max_roles];9]]
- $var[current_page;$input[rl.num]]
- $editMessage[$channelID;$messageID;;$var[ti];*Fetching Page `$input[rl.num]`...*;$var[col];$var[foo]]
- $endif
- $var[prev.arrow;<:Meow_PreviousPage:1179715759069470741>]
- $var[next.arrow;<:Meow_NextPage:1179715792292560977>]
- $var[last.arrow;<:Meow_LastPage:1179715820763500605>]
- $var[first.arrow;<:Meow_FirstPage:1179715724013477898>]
- $var[modal.emoji;📝]
- $removeAllComponents
- $async[buttons-edit]
- $editButton[roleList-$authorID-frontmenu;;primary;yes;$var[first.arrow];$messageID]
- $editButton[roleList-$authorID-backmenu;;primary;yes;$var[prev.arrow];$messageID]
- $editButton[rl-$authorID-customPageModal;;secondary;yes;$var[modal.emoji];$messageID]
- $editButton[roleList-$authorID-nextmenu;;primary;yes;$var[next.arrow];$messageID]
- $editButton[roleList-$authorID-lastmenu;;primary;yes;$var[last.arrow];$messageID]
- $endasync
- $var[msg.id;$messageID]
- $defer
- $httpAddHeader[guild-id;$guildID]
- $httpAddHeader[apikey;$getVar[ApiKey]]
- $httpAddHeader[bot-token;$getVar[ChocolaToken]]
- $async[members]
- $httpGet[https://bdfddata.rickyjs.xyz/release/guild/members]
- $var[mems;$httpResult]
- $endasync $await[members]
- $httpGet[https://bdfddata.rickyjs.xyz/release/guild/roles]
- $jsonParse[$httpResult]
- $var[Separator;$url[decode;%0A]]
- $var[Title;Server Roles ($var[rc])]
- $var[Description;$eval[$repeatMessage[10;%{DOL}%if[%{DOL}%json[details\;%{DOL}%var[start_role\]\;id\]!=\]%{DOL}%var[start_role\]. <@&%{DOL}%json[details\;%{DOL}%var[start_role\]\;id\]> - %{DOL}%textSplit[%{DOL}%var[mems\]\;%{DOL}%json[details\;%{DOL}%var[start_role\]\;id\]\]%{DOL}%var[no.%{DOL}%var[start_role\]\;%{DOL}%sub[%{DOL}%getTextSplitLength\;1\]\] **%{DOL}%var[no.%{DOL}%var[start_role\]\] %{DOL}%if[%{DOL}%var[no.%{DOL}%var[start_role\]\]==1\]Member%{DOL}%elseMembers%{DOL}%endif**%{DOL}%var[Separator\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[start_role\;%{DOL}%sum[1\;%{DOL}%var[start_role\]\]\]]]]
- $var[Color;$getEmbedData[$channelID;$messageID;1;color]]
- $var[Footer;Page $var[current_page]/$var[tpg]]
- $async[results]
- $editMessage[$channelID;$messageID;;$var[Title];$var[Description];$var[Color];$var[Footer]]
- $endasync
- $if[$or[$var[current_page]>$var[tpg];$var[current_page]<=0]==true]
- $editButton[roleList-$authorID-frontmenu;;primary;yes;$var[first.arrow];$var[msg.id]]
- $editButton[roleList-$authorID-backmenu;;primary;yes;$var[prev.arrow];$var[msg.id]]
- $editButton[rl-$authorID-customPageModal;;secondary;yes;$var[modal.emoji];$var[msg.id]]
- $editButton[roleList-$authorID-nextmenu;;primary;yes;$var[next.arrow];$var[msg.id]]
- $editButton[roleList-$authorID-lastmenu;;primary;yes;$var[last.arrow];$var[msg.id]]
- $else
- $editButton[roleList-$authorID-frontmenu;;primary;$checkCondition[$var[current_page]==1];$var[first.arrow];$var[msg.id]]
- $editButton[roleList-$authorID-backmenu;;primary;$checkCondition[$var[current_page]==1];$var[prev.arrow];$var[msg.id]]
- $editButton[rl-$authorID-customPageModal;;secondary;no;$var[modal.emoji];$var[msg.id]]
- $editButton[roleList-$authorID-nextmenu;;primary;$checkCondition[$var[current_page]==$var[tpg]];$var[next.arrow];$var[msg.id]]
- $editButton[roleList-$authorID-lastmenu;;primary;$checkCondition[$var[current_page]==$var[tpg]];$var[last.arrow];$var[msg.id]]
- $endif
- $else
- $ephemeral
- $removeButtons
- not your button!
- $endif
- $endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement