Advertisement
xloxn

Infinite Button Pages v3 w/ ForgePages (1/2)

Jun 13th, 2025 (edited)
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.25 KB | None | 0 0
  1. module.exports = {
  2.     name: "buttonPages",
  3.     type: "messageCreate",
  4.     code: `
  5.    
  6. $let[currentPage;1] $c[Initial page number]
  7. $let[authorOnly?;true] $c[Setting this to "true" enables interactions exclusively for the author.]
  8. $let[pageJumping?;true] $c[Setting this to "true" enables page jumping, allowing you to navigate through pages effortlessly.]
  9. $let[ID;testingButtonPages] $c[ID of the button pages]
  10.  
  11. $if[$get[authorOnly?]==true;
  12.    $let[ID;$get[ID]@$authorID] $c[This makes the button pages only visible to the author.]
  13.    ]
  14.  
  15. $c[Specifies the separator character to use for dividing data.]
  16. $let[separator;|]
  17.  
  18. $c[Defines the maximum number of data entries per page]
  19. $let[dataperpage;1]
  20.  
  21. $c[Allows for an unlimited number of pages, enabling continuous pagination.]
  22. $let[data;page1|page2|page3|page4|page5|page6|page7|page8|page9|page10]
  23.    
  24. $c[Initialize the ForgePages store]
  25. $!pagesInit[$get[ID];$get[separator];$get[data]]
  26.  
  27. $description[$pagesList[$get[ID];$get[currentPage];$get[dataperpage]]]
  28.    
  29. $footer[Page $get[currentPage] of $pageCount[$get[ID];$get[dataperpage]]]
  30.    
  31. $color[#2c2d31]
  32.    
  33. $if[$get[currentPage]==1;
  34.    $let[lldisabled;true]
  35.    $let[ldisabled;true]
  36.    ;
  37.    $let[lldisabled;false]
  38.    $let[ldisabled;false]
  39.    ]
  40.  
  41. $if[$get[currentPage]==$pageCount[$get[ID];$get[dataperpage]];
  42.    $let[rrdisabled;true]
  43.    $let[rdisabled;true]
  44.    ;
  45.    $let[rrdisabled;false]
  46.    $let[rdisabled;false]
  47.    ]
  48.    
  49. $addActionRow
  50.  
  51. $addButton[Apages-$get[ID]-1-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-ll; ;Secondary;⏪;$get[lldisabled]]
  52. $addButton[Apages-$get[ID]-$sub[$get[currentPage];1]-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-l; ;Secondary;⬅️;$get[ldisabled]]
  53.    
  54. $if[$get[pageJumping?]==true;
  55.    $addButton[Apages-$get[ID]-jump-$get[dataperpage]-$get[pageJumping?]-$get[currentPage];$get[currentPage] / $pageCount[$get[ID];$get[dataperpage]];Primary;;false]]
  56.        
  57. $addButton[Apages-$get[ID]-$sum[$get[currentPage];1]-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-r; ;Secondary;➡️;$get[rdisabled]]
  58. $addButton[Apages-$get[ID]-$pageCount[$get[ID];$get[dataperpage]]-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-rr; ;Secondary;⏩;$get[rrdisabled]]
  59.  
  60.     `}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement