Advertisement
Aouchan

Server Roles List's Interaction Part

Nov 30th, 2023 (edited)
1,452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 6.44 KB | Source Code | 0 0
  1. Trigger: $onInteraction
  2.  
  3. $nomention
  4. $botListHide
  5.  
  6. $textSplit[$customID;-]
  7.  
  8. $var[prev-arrow.emoji;<:Meow_PreviousPage:1179715759069470741>]
  9. $var[next-arrow.emoji;<:Meow_NextPage:1179715792292560977>]
  10. $var[last-arrow.emoji;<:Meow_LastPage:1179715820763500605>]
  11. $var[first-arrow.emoji;<:Meow_FirstPage:1179715724013477898>]
  12.  
  13. $var[note.emoji;📝]
  14. $var[loading.emoji;🔄]
  15. $var[color;84e7e2]
  16.  
  17. $if[$splitText[1]==GuildRolesListModal]
  18.     $if[$splitText[2]==$authorID]
  19.         $if[$splitText[3]==CustomPageModal]
  20.             $newModal[GuildRolesList-$authorID-CustomPageInput;Server Roles list]
  21.             $addTextInput[specific.page.num;short;Page Number;1;2;true;;2]
  22.         $endif
  23.     $else
  24.         $ephemeral
  25.         $removeAllComponents
  26.         This is not your button!
  27.     $endif
  28. $endif
  29.  
  30. $if[$splitText[1]==GuildRolesList]
  31.     $if[$splitText[2]==$authorID]
  32.    
  33.         $var[chan-id;$channelID]
  34.         $var[msg-id;$messageID]
  35.        
  36.         $async[fetch_current_page]
  37.            $textSplit[$replaceText[$getEmbedData[$var[chan-id];$var[msg-id];1;footer];Page;];/]
  38.            $var[current.page;$splitText[1]]
  39.            
  40.            $var[footer.data;$getEmbedData[$var[chan-id];$var[msg-id];1;footer]]
  41.            $var[title.data;$getEmbedData[$var[chan-id];$var[msg-id];1;title]]
  42.         $endasync $await[fetch_current_page]
  43.        
  44.         $async[total_pages_math]
  45.           $var[guild.roles.count;$sub[$roleCount;1]]
  46.          
  47.           $enableDecimals[true]
  48.           $var[div;$divide[$var[guild.roles.count];10]]
  49.          
  50.           $if[$checkContains[$var[div];.]==true]
  51.               $textSplit[$var[div];.]
  52.               $var[total.pages;$sum[1;$splitText[1]]]
  53.           $else
  54.               $var[total.pages;$var[div]]
  55.           $endif
  56.         $endasync $await[total_pages_math]
  57.        
  58.         $if[$splitText[3]==FirstPage]
  59.             $var[updated.page;1]
  60.         $elseif[$splitText[3]==PrevPage]
  61.             $var[updated.page;$sub[$var[current.page];1]]
  62.         $elseif[$splitText[3]==NextPage]
  63.             $var[updated.page;$sum[$var[current.page];1]]
  64.         $elseif[$splitText[3]==LastPage]
  65.             $var[updated.page;$var[total.pages]]
  66.         $elseif[$splitText[3]==CustomPageInput]
  67.             $var[input;$input[specific.page.num]]
  68.            
  69.             $if[$isNumber[$var[input]]==false]
  70.                 $var[updated.page;1]
  71.             $else
  72.                 $var[updated.page;$round[$var[input]]]
  73.             $endif
  74.         $endif
  75.        
  76.         $if[$or[$var[updated.page]<=0;$var[updated.page]>$var[total.pages]]==true]
  77.             $var[updated.page;$var[total.pages]]
  78.         $endif
  79.        
  80.         $async[disable_buttons]
  81.            $removeAllComponents[$var[msg-id]]
  82.            $addButton[no;first-page;;primary;true;$var[first-arrow.emoji];$var[msg-id]]
  83.            $addButton[no;prev-page;;primary;true;$var[prev-arrow.emoji];$var[msg-id]]
  84.            $addButton[no;custom-page;;secondary;true;$var[note.emoji];$var[msg-id]]
  85.            $addButton[no;next-page;;primary;true;$var[next-arrow.emoji];$var[msg-id]]
  86.            $addButton[no;last-page;;primary;true;$var[last-arrow.emoji];$var[msg-id]]    
  87.         $endasync
  88.        
  89.         $if[$splitText[3]==FirstPage]
  90.             $editMessage[$var[chan-id];$var[msg-id];;$var[title.data];Loading First Page $var[loading.emoji];$var[color];$var[footer.data]]        
  91.         $elseif[$splitText[3]==PrevPage]
  92.             $editMessage[$var[chan-id];$var[msg-id];;$var[title.data];Loading Previous Page $var[loading.emoji];$var[color];$var[footer.data]]
  93.         $elseif[$splitText[3]==NextPage]
  94.             $editMessage[$var[chan-id];$var[msg-id];;$var[title.data];Loading Next Page $var[loading.emoji];$var[color];$var[footer.data]]
  95.         $elseif[$splitText[3]==LastPage]
  96.             $editMessage[$var[chan-id];$var[msg-id];;$var[title.data];Loading Last Page $var[loading.emoji];$var[color];$var[footer.data]]
  97.         $else
  98.             $editMessage[$var[chan-id];$var[msg-id];;$var[title.data];Loading `$var[updated.page]` Page $var[loading.emoji];$var[color];$var[footer.data]]            
  99.         $endif
  100.        
  101.         $defer        
  102.         $var[key;$getVar[ApiKey]]
  103.         $var[token;$getVar[BotToken]]
  104.        
  105.         $httpAddHeader[guild-id;$guildID]
  106.         $httpAddHeader[apikey;$var[key]]
  107.         $httpAddHeader[bot-token;$var[token]]
  108.        
  109.         $httpGet[https://bdfddata.rickyjs.xyz/release/guild/roles]
  110.         $jsonParse[$httpResult]
  111.        
  112.         $async[]
  113.            $httpGet[https://bdfddata.rickyjs.xyz/release/guild/members]
  114.            $var[mems;$httpResult]
  115.         $endasync $await[]
  116.        
  117.         $var[h;$sub[$multi[$var[updated.page];10];9]]
  118.         $var[sep;$url[decode;%0A]]
  119.        
  120.         $var[title;Server Roles ($var[guild.roles.count])]
  121.         $var[description;$eval[$repeatMessage[10;%{DOL}%if[%{DOL}%json[details\;%{DOL}%var[h\]\;id\]!=\]%{DOL}%var[h\]. <@&%{DOL}%json[details\;%{DOL}%var[h\]\;id\]> - %{DOL}%textSplit[%{DOL}%var[mems\]\;%{DOL}%json[details\;%{DOL}%var[h\]\;id\]\]%{DOL}%var[r.%{DOL}%var[h\]\;%{DOL}%sub[%{DOL}%getTextSplitLength\;1\]\] **%{DOL}%var[r.%{DOL}%var[h\]\] %{DOL}%if[%{DOL}%var[r.%{DOL}%var[h\]\]==1\]Member%{DOL}%elseMembers%{DOL}%endif**%{DOL}%var[sep\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[h\;%{DOL}%sum[1\;%{DOL}%var[h\]\]\]]]]
  122.         $var[color;$var[color]]
  123.         $var[footer;Page $var[updated.page]/$var[total.pages]]
  124.        
  125.         $async[results]
  126.           $editMessage[$var[chan-id];$var[msg-id];;$var[title];$var[description];$var[color];$var[footer]]
  127.          
  128.           $removeAllComponents[$var[msg-id]]
  129.           $addButton[no;GuildRolesList-$authorID-FirstPage;;primary;$checkCondition[$var[updated.page]==1];$var[first-arrow.emoji];$var[msg-id]]
  130.           $addButton[no;GuildRolesList-$authorID-PrevPage;;primary;$checkCondition[$var[updated.page]==1];$var[prev-arrow.emoji];$var[msg-id]]
  131.           $addButton[no;GuildRolesListModal-$authorID-CustomPageModal;;secondary;no;$var[note.emoji];$var[msg-id]]
  132.           $addButton[no;GuildRolesList-$authorID-NextPage;;primary;$checkCondition[$var[updated.page]==$var[total.pages]];$var[next-arrow.emoji];$var[msg-id]]
  133.           $addButton[no;GuildRolesList-$authorID-LastPage;;primary;$checkCondition[$var[updated.page]==$var[total.pages]];$var[last-arrow.emoji];$var[msg-id]]
  134.         $endasync              
  135.     $else
  136.         $ephemeral
  137.         $removeAllComponents
  138.         This is not your button!
  139.     $endif
  140. $endif
  141.  
Tags: BDFD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement