Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = {
- name: "pages",
- type: "messageCreate",
- code: `
- $let[authorOnly;true] $c[Setting this to “true” enables interactions exclusively for the author.]
- $let[pageJumping;true] $c[Setting this to “true” enables page jumping, allowing you to navigate through pages effortlessly.]
- $let[separator;|] $c[Specifies the separator character to use for dividing data.]
- $let[dataperpage;1] $c[Defines the maximum number of data entries per page, with a limit of 10.]
- $let[data;page1|page2|page3|page4|page5|page6...] $c[Allows for an unlimited number of pages, enabling continuous pagination.]
- $arrayLoad[data;$get[separator];$get[data]]
- $description[
- $trimStart[$trimEnd[
- $if[$get[dataperpage]>=1;
- $arrayAt[data;0]]
- $if[$get[dataperpage]>=2;
- $arrayAt[data;1]]
- $if[$get[dataperpage]>=3;
- $arrayAt[data;2]]
- $if[$get[dataperpage]>=4;
- $arrayAt[data;3]]
- $if[$get[dataperpage]>=5;
- $arrayAt[data;4]]
- $if[$get[dataperpage]>=6;
- $arrayAt[data;5]]
- $if[$get[dataperpage]>=7;
- $arrayAt[data;6]]
- $if[$get[dataperpage]>=8;
- $arrayAt[data;7]]
- $if[$get[dataperpage]>=9;
- $arrayAt[data;8]]
- $if[$get[dataperpage]>=10;
- $arrayAt[data;9]]
- ]]
- ]
- $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]]] ]
- $footer[Page 1 of $get[pages]]
- $color[#2c2d31]
- $addActionRow
- $addButton[1first-1-1-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⏪;true]
- $addButton[1page-1-1-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⬅️;true]
- $if[$get[pageJumping]==true;
- $addButton[1page-jump-1-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping];1 / $get[pages];Primary;;false]]
- $if[$or[$arrayAt[data;0]==;$arrayAt[data;$sum[$get[dataperpage];1]]==]==true;
- $let[rdisabled;true];
- $let[rdisabled;false]]
- $addButton[1page-2-1-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;➡️;$get[rdisabled]]
- $addButton[1last-$get[pages]-1-$get[pages]-$get[dataperpage]-$get[separator]-$authorID-$get[authorOnly]-$get[pageJumping]; ;Secondary;⏩;$get[rdisabled]]
- $setVar[1data;$authorID;$get[data]]
- `}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement