Advertisement
xloxn

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

Jun 13th, 2025 (edited)
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.55 KB | None | 0 0
  1. module.exports = {
  2.     type: "interactionCreate",
  3.     code: `
  4. $if[$checkContains[$customID;Apages]==true;
  5. $arrayLoad[customID;-;$customID]
  6. $let[ID;$arrayAt[customID;1]]
  7. $let[currentPage;$arrayAt[customID;2]]
  8. $let[dataperpage;$arrayAt[customID;3]]
  9. $let[pageJumping?;$arrayAt[customID;4]]
  10. $let[previousPage;$arrayAt[customID;5]]
  11.    
  12. $c[Prevent non-authors from using this interaction if authorOnly is true]   $onlyIf[$or[$and[$checkContains[$get[ID];@]==true;$checkContains[$get[ID];$authorID]==false]==true]==false;
  13.    $ephemeral
  14.    $description[This interaction isn't for you!]
  15.    ]
  16.    
  17. $if[$checkContains[$get[currentPage];hop]==true;
  18. $onlyIf[$or[$isInteger[$input[page]]==false;$input[page]>$pageCount[$get[ID];$get[dataperpage]];$input[page]<1]==false;
  19.    $ephemeral
  20.    $description[Please input a valid page number!]
  21.    ]
  22.  
  23.    $let[currentPage;$input[page]]
  24.    ]
  25.  
  26. $if[$checkContains[$get[currentPage];jump]==true;
  27.    $modal[Apages-$get[ID]-hop-$get[dataperpage]-$get[pageJumping?]-$get[currentPage];Jump to Page]
  28.    $addTextInput[page;Page Number;Short;true;$get[previousPage] / $pageCount[$get[ID];$get[dataperpage]];$get[previousPage];1;$charCount[$pageCount[$get[ID];$get[dataperpage]]]]
  29.    ;
  30.    
  31. $interactionUpdate
  32.    
  33. $description[$pagesList[$get[ID];$get[currentPage];$get[dataperpage]]]
  34.    
  35. $footer[Page $get[currentPage] of $pageCount[$get[ID];$get[dataperpage]]]
  36. $color[#2c2d31]
  37.  
  38. $if[$get[currentPage]==1;
  39.    $let[lldisabled;true]
  40.    $let[ldisabled;true]
  41.    ;
  42.    $let[lldisabled;false]
  43.    $let[ldisabled;false]
  44.    ]
  45.  
  46. $if[$get[currentPage]==$pageCount[$get[ID];$get[dataperpage]];
  47.    $let[rrdisabled;true]
  48.    $let[rdisabled;true]
  49.    ;
  50.    $let[rrdisabled;false]
  51.    $let[rdisabled;false]
  52.    ]
  53.  
  54. $addActionRow
  55.  
  56. $addButton[Apages-$get[ID]-1-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-rr;;Secondary;⏪;$get[lldisabled]]
  57. $addButton[Apages-$get[ID]-$sub[$get[currentPage];1]-$get[dataperpage]-$get[pageJumping?]--$get[currentPage]-r;;Secondary;⬅️;$get[ldisabled]]
  58.  
  59. $if[$get[pageJumping?]==true;
  60.    $addButton[Apages-$get[ID]-jump-$get[dataperpage]-$get[pageJumping?]-$get[currentPage];$get[currentPage] / $pageCount[$get[ID];$get[dataperpage]];Primary;;false]
  61.    ]
  62.  
  63. $addButton[Apages-$get[ID]-$sum[$get[currentPage];1]-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-l;;Secondary;➡️;$get[rdisabled]]
  64. $addButton[Apages-$get[ID]-$pageCount[$get[ID];$get[dataperpage]]-$get[dataperpage]-$get[pageJumping?]-$get[currentPage]-ll;;Secondary;⏩;$get[rrdisabled]]
  65.    
  66.    ]]
  67.    
  68.    `}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement