Advertisement
Aouchan

Server Roles List's Interaction Part

Nov 30th, 2023 (edited)
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 7.51 KB | Source Code | 0 0
  1. Trigger: $onInteraction
  2.  
  3. $nomention
  4. $botListHide
  5.  
  6. $textSplit[$customID;-]
  7.  
  8. $if[$splitText[1]==rl]
  9.     $if[$splitText[2]==$authorID]
  10.         $if[$splitText[3]==customPageModal]
  11.             $newModal[roleList-$authorID-selectpageRL;Server Roles list]
  12.             $addTextInput[rl.num;short;Page Number;1;2;true]
  13.         $endif
  14.     $else
  15.         $ephemeral
  16.         $removeAllComponents
  17.         not your button!
  18.     $endif
  19. $endif
  20.  
  21. $if[$splitText[1]==roleList]
  22.     $if[$splitText[2]==$authorID]
  23.     $try
  24.      $async[math]
  25.        $textSplit[$replaceText[$getEmbedData[$channelID;$messageID;1;footer];Page;];/]
  26.           $var[currentPage;$splitText[1]]
  27.           $var[rc;$sub[$roleCount;1]]
  28.  
  29.           $enableDecimals[true]
  30.           $var[div;$divide[$var[rc];10]]
  31.        
  32.           $if[$checkContains[$var[div];.]==true]
  33.               $textSplit[$var[div];.]
  34.               $var[tpg;$sum[1;$splitText[1]]]
  35.           $else
  36.               $var[tpg;$var[div]]
  37.           $endif
  38.      $endasync $await[math]
  39.     $catch
  40.       $ephemeral
  41.       $removeAllComponents
  42.       There was an error, you might have to run this command again
  43.       $stop
  44.     $endtry
  45.           $var[foo;$getEmbedData[$channelID;$messageID;1;footer]]
  46.           $var[col;$getEmbedData[$channelID;$messageID;1;color]]
  47.           $var[ti;$getEmbedData[$channelID;$messageID;1;title]]
  48.          
  49.       $if[$splitText[3]==backmenu]
  50.            
  51.             $var[max_roles;$multi[$sub[$var[currentPage];1];10]]
  52.             $var[start_role;$sub[$var[max_roles];9]]
  53.             $var[current_page;$sub[$var[currentPage];1]]        
  54.             $editMessage[$channelID;$messageID;;$var[ti];*Fetching Previous Page...*;$var[col];$var[foo]]
  55.            
  56.         $elseif[$splitText[3]==nextmenu]
  57.            
  58.             $var[max_roles;$multi[$sum[$var[currentPage];1];10]]
  59.             $var[start_role;$sub[$var[max_roles];9]]
  60.             $var[current_page;$sum[$var[currentPage];1]]            
  61.             $editMessage[$channelID;$messageID;;$var[ti];*Fetching Next Page...*;$var[col];$var[foo]]
  62.            
  63.         $elseif[$splitText[3]==frontmenu]
  64.        
  65.             $var[max_roles;$multi[1;10]]
  66.             $var[start_role;$sub[$var[max_roles];9]]
  67.             $var[current_page;1]                    
  68.             $editMessage[$channelID;$messageID;;$var[ti];*Fetching First Page...*;$var[col];$var[foo]]
  69.            
  70.         $elseif[$splitText[3]==lastmenu]
  71.        
  72.             $var[max_roles;$multi[$var[tpg];10]]
  73.             $var[start_role;$sub[$var[max_roles];9]]
  74.             $var[current_page;$var[tpg]]    
  75.             $editMessage[$channelID;$messageID;;$var[ti];*Fetching Last Page...*;$var[col];$var[foo]]
  76.            
  77.         $elseif[$splitText[3]==selectpageRL]
  78.             $if[$isNumber[$input[rl.num]]==false]
  79.                 $ephemeral
  80.                 $removeAllComponents
  81.                 Please input a valid number
  82.                 $stop
  83.             $endif
  84.             $if[$checkContains[$input[rl.num];.]==true]
  85.                 $ephemeral
  86.                 $removeAllComponents
  87.                 You can not put floats/decimals in your number!
  88.                 $stop
  89.             $endif
  90.             $if[$input[rl.num]<=0]
  91.                 $ephemeral
  92.                 $removeAllComponents
  93.                 You can not put `0` or a negative number
  94.                 $stop
  95.             $endif
  96.             $if[$input[rl.num]>$var[tpg]]
  97.                 $ephemeral
  98.                 $removeAllComponents
  99.                 Page `$input[rl.num]` does not exist!
  100.                 $stop
  101.             $endif
  102.                 $var[max_roles;$multi[$input[rl.num];10]]
  103.                 $var[start_role;$sub[$var[max_roles];9]]
  104.                 $var[current_page;$input[rl.num]]                
  105.                 $editMessage[$channelID;$messageID;;$var[ti];*Fetching Page `$input[rl.num]`...*;$var[col];$var[foo]]  
  106.         $endif
  107.        
  108.         $var[prev.arrow;<:Meow_PreviousPage:1179715759069470741>]
  109.         $var[next.arrow;<:Meow_NextPage:1179715792292560977>]
  110.         $var[last.arrow;<:Meow_LastPage:1179715820763500605>]
  111.         $var[first.arrow;<:Meow_FirstPage:1179715724013477898>]
  112.         $var[modal.emoji;📝]
  113.  
  114.         $removeAllComponents
  115.         $async[buttons-edit]
  116.            $editButton[roleList-$authorID-frontmenu;;primary;yes;$var[first.arrow];$messageID]
  117.              $editButton[roleList-$authorID-backmenu;;primary;yes;$var[prev.arrow];$messageID]
  118.               $editButton[rl-$authorID-customPageModal;;secondary;yes;$var[modal.emoji];$messageID]
  119.              $editButton[roleList-$authorID-nextmenu;;primary;yes;$var[next.arrow];$messageID]
  120.            $editButton[roleList-$authorID-lastmenu;;primary;yes;$var[last.arrow];$messageID]
  121.         $endasync
  122.        
  123.         $var[msg.id;$messageID]
  124.        
  125.         $defer
  126.         $httpAddHeader[guild-id;$guildID]
  127.         $httpAddHeader[apikey;$getVar[ApiKey]]
  128.         $httpAddHeader[bot-token;$getVar[ChocolaToken]]
  129.        
  130.         $async[members]
  131.            $httpGet[https://bdfddata.rickyjs.xyz/release/guild/members]
  132.            $var[mems;$httpResult]
  133.         $endasync $await[members]
  134.        
  135.         $httpGet[https://bdfddata.rickyjs.xyz/release/guild/roles]
  136.         $jsonParse[$httpResult]
  137.  
  138.         $var[Separator;$url[decode;%0A]]  
  139.         $var[Title;Server Roles ($var[rc])]
  140.         $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\]\]\]]]]
  141.         $var[Color;$getEmbedData[$channelID;$messageID;1;color]]
  142.         $var[Footer;Page $var[current_page]/$var[tpg]]  
  143.      
  144.        $async[results]
  145.          $editMessage[$channelID;$messageID;;$var[Title];$var[Description];$var[Color];$var[Footer]]
  146.        $endasync
  147.        
  148.         $if[$or[$var[current_page]>$var[tpg];$var[current_page]<=0]==true]
  149.             $editButton[roleList-$authorID-frontmenu;;primary;yes;$var[first.arrow];$var[msg.id]]
  150.             $editButton[roleList-$authorID-backmenu;;primary;yes;$var[prev.arrow];$var[msg.id]]
  151.             $editButton[rl-$authorID-customPageModal;;secondary;yes;$var[modal.emoji];$var[msg.id]]
  152.             $editButton[roleList-$authorID-nextmenu;;primary;yes;$var[next.arrow];$var[msg.id]]
  153.             $editButton[roleList-$authorID-lastmenu;;primary;yes;$var[last.arrow];$var[msg.id]]
  154.         $else
  155.             $editButton[roleList-$authorID-frontmenu;;primary;$checkCondition[$var[current_page]==1];$var[first.arrow];$var[msg.id]]
  156.             $editButton[roleList-$authorID-backmenu;;primary;$checkCondition[$var[current_page]==1];$var[prev.arrow];$var[msg.id]]
  157.             $editButton[rl-$authorID-customPageModal;;secondary;no;$var[modal.emoji];$var[msg.id]]
  158.             $editButton[roleList-$authorID-nextmenu;;primary;$checkCondition[$var[current_page]==$var[tpg]];$var[next.arrow];$var[msg.id]]
  159.             $editButton[roleList-$authorID-lastmenu;;primary;$checkCondition[$var[current_page]==$var[tpg]];$var[last.arrow];$var[msg.id]]
  160.         $endif
  161.     $else
  162.         $ephemeral
  163.         $removeButtons
  164.         not your button!
  165.     $endif
  166. $endif
Tags: BDFD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement