Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = {
- type: "interactionCreate",
- code: `
- $if[$checkContains[$customID;1first;1last;1page]==true;
- $arrayLoad[customID;-;$replace[$customID;hop;$input[page]]]
- $let[nextlocation;$arrayAt[customID;1]]
- $let[current;$arrayAt[customID;2]]
- $let[pages;$arrayAt[customID;3]]
- $let[dataperpage;$arrayAt[customID;4]]
- $let[separator;$arrayAt[customID;5]]
- $let[authorOnly;$arrayAt[customID;7]]
- $let[pageJumping;$arrayAt[customID;8]]
- $let[data;$getVar[1data;$authorID;]]
- $if[$checkContains[$customID;hop]==true;
- $ifx[ $if[$isNumber[$input[page]]==false;$interactionReply[$ephemeral
- $description[Please input a valid page number]
- $color[#2c2d31]] $stop]
- $elseif[$isInteger[$input[page]]==false;
- $interactionReply[$ephemeral
- $description[Please input a valid page number]
- $color[#2c2d31]] $stop]
- $elseif[$or[$input[page]>$get[pages];$input[page]<=0]==true;
- $interactionReply[$ephemeral
- $description[Please input a valid page number]
- $color[#2c2d31]] $stop]
- ]]
- $arrayLoad[data;$get[separator];$get[data]]
- $ifx[
- $if[$and[$get[authorOnly]==true;$checkContains[$customID;$authorID]==false]==true;
- $interactionReply[$ephemeral
- $description[This isn't for you]
- $color[#2c2d31]]]
- $elseif[$and[$get[pageJumping]==true;$checkContains[$customID;jump]==true]==true;
- $modal[$replace[$customID;jump;hop];Input a Page]
- $addTextInput[page;Page Number;Short;true;$get[current] / $get[pages];$get[current];1;3]]
- $else[
- $let[sum;$math[($get[dataperpage]*$get[nextlocation])-$get[dataperpage]]]
- $if[$checkContains[$divide[$arrayLength[data];$get[dataperpage]];.]==true;
- $arrayLoad[pages;.;$divide[$arrayLength[data];$get[dataperpage]]]
- $let[pages;$sum[$arrayAt[pages;0];1]]
- ;
- $let[pages;$divide[$arrayLength[data];$get[dataperpage]]]]
- $interactionUpdate[
- $description[
- $trimStart[$trimEnd[
- $if[$get[dataperpage]>=1;
- $arrayAt[data;$sum[$get[sum];0]]]
- $if[$get[dataperpage]>=2;
- $arrayAt[data;$sum[$get[sum];1]]]
- $if[$get[dataperpage]>=3;
- $arrayAt[data;$sum[$get[sum];2]]]
- $if[$get[dataperpage]>=4;
- $arrayAt[data;$sum[$get[sum];3]]]
- $if[$get[dataperpage]>=5;
- $arrayAt[data;$sum[$get[sum];4]]]
- $if[$get[dataperpage]>=6;
- $arrayAt[data;$sum[$get[sum];5]]]
- $if[$get[dataperpage]>=7;
- $arrayAt[data;$sum[$get[sum];6]]]
- $if[$get[dataperpage]>=8;
- $arrayAt[data;$sum[$get[sum];7]]]
- $if[$get[dataperpage]>=9;
- $arrayAt[data;$sum[$get[sum];8]]]
- $if[$get[dataperpage]>=10;
- $arrayAt[data;$sum[$get[sum];9]]]
- ]]
- ]
- $footer[Page $get[nextlocation] of $get[pages]]
- $color[#2c2d31]
- $deleteActionRow[1]
- $addActionRow
- $if[$get[nextlocation]==1;
- $let[ldisabled;true];
- $let[ldisabled;false]]
- $addButton[1first-1-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⏪;$get[ldisabled]]
- $addButton[1page-$sub[$get[nextlocation];1]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⬅️;$get[ldisabled]]
- $if[$get[pageJumping]==true;
- $addButton[1page-jump-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping];$get[nextlocation] / $get[pages];Primary]]
- $if[$get[nextlocation]==$get[pages];
- $let[rdisabled;true];
- $let[rdisabled;false]]
- $addButton[1page-$sum[$get[nextlocation];1]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;➡️;$get[rdisabled]]
- $addButton[1last-$get[pages]-$get[nextlocation]-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⏩;$get[rdisabled]]
- ]]]]
- `}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement