Advertisement
Aouchan

/banned-users's Interaction Code

Apr 11th, 2024 (edited)
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 10.92 KB | Source Code | 0 0
  1. $nomention
  2. $textSplit[$customID;-]
  3.  
  4. $if[$splitText[1]==ServerBannedUser]
  5.     $if[$splitText[2]==$authorID]
  6.         $if[$or[$isAdmin[$authorID]==true;$checkUserPerms[$authorID;ban]==true]==false]
  7.             $ephemeral
  8.             $removeAllComponents
  9.             You don't have enough permissions to use this!
  10.        $else
  11.            $newModal[Given.Banned.UserID;Guild Banned Users List]
  12.            $addTextInput[user.id;short;User ID of a banned user;15;22;true;;$botID]
  13.        $endif
  14.    $else
  15.        $ephemeral
  16.        $removeAllComponents
  17.        This is not your button!
  18.    $endif
  19. $endif
  20.  
  21. $if[$splitText[1]==Given.Banned.UserID]
  22.    $ephemeral
  23.    $var[color;fffafa]
  24.    
  25.    $if[$or[$isAdmin[$authorID]==true;$checkUserPerms[$authorID;ban]==true]==false]
  26.        You don't have enough permissions to use this!
  27.         $stop
  28.     $endif
  29.    
  30.     $if[$userExists[$input[user.id]]==false]
  31.         ❌ `$input[user.id]` is an Invalid UserID
  32.     $else
  33.         $var[user;$input[user.id]]
  34.        
  35.         $try
  36.           $var[reason;$getBanReason[$var[user]]]
  37.           $var[username;$username[$var[user]]]
  38.           $var[avatar;$userAvatar[$var[user]]]
  39.           $var[newline;$url[decode;%0A]]
  40.            
  41.           $author[$serverName[$guildID]]
  42.           $authorIcon[$serverIcon[$guildID]]
  43.           $description[» **Mention:** <@$var[user]>$var[newline]» **Reason:** $var[reason]]
  44.           $footer[Username: $var[username]]
  45.           $color[$var[color]]
  46.           $thumbnail[$var[avatar]]
  47.         $catch
  48.           ❌ That user isn't banned in this server!
  49.        $endtry
  50.    $endif
  51. $endif
  52.  
  53. $if[$splitText[1]==ServerBanListPage]
  54.    $if[$splitText[2]==$authorID]
  55.        $if[$or[$isAdmin[$authorID]==true;$checkUserPerms[$authorID;ban]==true]==false]
  56.            $ephemeral
  57.            $removeAllComponents
  58.            You don't have enough permissions to use this!
  59.         $else
  60.             $newModal[Guild.Ban.UsersList.CustomPage;Guild Banned Users List]
  61.             $addTextInput[page.number;short;Page Number;1;10;true;;7]
  62.         $endif
  63.     $else
  64.         $ephemeral
  65.         $removeAllComponents
  66.         This is not your button!
  67.     $endif    
  68. $endif
  69. $if[$splitText[1]==Guild.Ban.UsersList.CustomPage]
  70.     $var[page;$input[page.number]]
  71.     $ephemeral
  72.    
  73.     $if[$or[$isAdmin[$authorID]==true;$checkUserPerms[$authorID;ban]==true]==false]
  74.         You don't have enough permissions to use this!
  75.        $stop
  76.    $endif
  77.    
  78.    $var[color;fffafa]
  79.    $httpAddHeader[apikey;$getVar[ApiKey]]
  80.    $httpAddHeader[bot-token;$getVar[BotToken]]
  81.    $httpAddHeader[guild-id;$guildID]
  82.     $httpGet[https://bdfddata.rickyjs.xyz/release/guild/bans]
  83.     $jsonParse[$httpResult]
  84.        
  85.     $var[details.length;$jsonArrayCount[details]]
  86.        
  87.     $async[math]
  88.        $textSplit[$replaceText[$getEmbedData[$channelID;$messageID;1;footer];Page;];/]
  89.        $var[current.page;$splitText[1]]
  90.          
  91.        $enableDecimals[true]
  92.        $var[div;$divide[$var[details.length];10]]
  93.          
  94.        $if[$checkContains[$var[div];.]==true]
  95.            $textSplit[$var[div];.]
  96.            $var[total.pages;$sum[$splitText[1];1]]
  97.        $else
  98.            $var[total.pages;$splitText[1]]
  99.        $endif
  100.     $endasync $await[math]
  101.    
  102.    $if[$isNumber[$var[page]]==false]
  103.        ❌ Please input a valid number!
  104.    $elseif[$checkContains[$var[page];.]==true]
  105.        ❌ You can not have decimals/floats in your number!
  106.    $elseif[$var[page]<=0]
  107.        ❌ You can not have `0` or a negative number!
  108.    $elseif[$var[page]>$var[total.pages]]
  109.        ❌ Page `$var[page]` does not exist!
  110.    $else
  111.        $var[final.point;$multi[$var[page];10]]
  112.        
  113.        $var[q;$sub[$sub[$var[final.point];9];1]]
  114.        $var[sep;$url[decode;%0A]]
  115.        $var[users;$eval[$repeatMessage[10;%{DOL}%if[%{DOL}%json[details\;%{DOL}%var[q\]\]!=\]%{DOL}%sum[%{DOL}%var[q\]\;1\]. %{DOL}%var[get.user\;%{DOL}%json[details\;%{DOL}%var[q\]\;user\;id\]\]<@%{DOL}%var[get.user\]> ***(@%{DOL}%username[%{DOL}%var[get.user\]\])***%{DOL}%var[reason\;%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%json[details\;%{DOL}%var[q\]\;reason\]\;`\;\]\;%{DOL}%var[sep\]\; \]\] - %{DOL}%trimSpace[%{DOL}%if[%{DOL}%var[reason\]==\]`No reason given.`%{DOL}%else `%{DOL}%var[reason\]`%{DOL}%endif\]%{DOL}%var[sep\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[q\;%{DOL}%calculate[%{DOL}%var[q\] + 1\]\]]]]
  116.        $authorIcon[$serverIcon[$guildID]]
  117.        $author[$serverName[$guildID]]
  118.        $title[*Page $var[page]*]
  119.        $description[$var[users]]
  120.        $color[$var[color]]
  121.    $endif
  122. $endif
  123.  
  124. $if[$splitText[1]==GuildUsersBanList]
  125.    $if[$splitText[2]==$authorID]
  126.        $if[$or[$isAdmin[$authorID]==true;$checkUserPerms[$authorID;ban]==true]==false]
  127.            $ephemeral
  128.            $removeAllComponents
  129.            You don't have enough permissions to use this!
  130.             $stop
  131.         $endif
  132.        
  133.         $var[first.page.arrow;<:Pixelated_FirstArrow:1193452503589716078>]
  134.         $var[last.page.arrow;<:Pixelated_LastArrow:1193452401831710720>]
  135.         $var[next.page.arrow;<:Pixelated_NextArrow:1193452428230672435>]
  136.         $var[prev.page.arrow;<:Pixelated_PrevArrow:1193452525832126464>]
  137.         $var[red.cross;<:VN_RedCross:1068802990657519686>]
  138.         $var[color;fffafa]
  139.        
  140.         $removeAllComponents
  141.         $async[]
  142.           $editButton[GuildUsersBanList-$authorID-FirstPage;;primary;true;$var[first.page.arrow];$messageID]
  143.           $editButton[GuildUsersBanList-$authorID-PrevPage;;primary;true;$var[prev.page.arrow];$messageID]
  144.           $editButton[GuildUsersBanList-$authorID-NextPage;;primary;true;$var[next.page.arrow];$messageID]
  145.           $editButton[GuildUsersBanList-$authorID-LastPage;;primary;true;$var[last.page.arrow];$messageID]
  146.           $editButton[DeleteEmbedMsg-$authorID;;danger;true;$var[red.cross];$messageID]
  147.           $editButton[ServerBannedUser-$authorID;Search a User;secondary;true;👤;$messageID]
  148.           $editButton[ServerBanListPage-$authorID;A Specific Page;secondary;true;📝;$messageID]
  149.           $editMessage[$channelID;$messageID;;;Loading...;$var[color];$getEmbedData[$channelID;$messageID;1;footer]]
  150.         $endasync
  151.        
  152.         $c[ // ^ Disabling buttons until the page is fetched ]
  153.                      
  154.         $httpAddHeader[apikey;$getVar[ApiKey]]
  155.         $httpAddHeader[bot-token;$getVar[BotToken]]
  156.         $httpAddHeader[guild-id;$guildID]
  157.          $httpGet[https://bdfddata.rickyjs.xyz/release/guild/bans]
  158.          $jsonParse[$httpResult]
  159.          
  160.          $var[details.length;$jsonArrayCount[details]]
  161.          
  162.          $if[$var[details.length]==0]
  163.              $author[$serverName[$guildID]]
  164.              $authorIcon[$serverIcon[$guildID]]
  165.              $description[There are no banned users!]
  166.              $color[$var[color]]
  167.              $stop
  168.          $endif
  169.        
  170.         $defer      
  171.         $async[math]
  172.           $textSplit[$replaceText[$getEmbedData[$channelID;$messageID;1;footer];Page;];/]
  173.           $var[current.page;$splitText[1]]
  174.          
  175.           $enableDecimals[true]
  176.           $var[div;$divide[$var[details.length];10]]
  177.          
  178.           $if[$checkContains[$var[div];.]==true]
  179.               $textSplit[$var[div];.]
  180.               $var[total.pages;$sum[$splitText[1];1]]
  181.           $else
  182.               $var[total.pages;$splitText[1]]
  183.           $endif
  184.         $endasync $await[math]
  185.        
  186.         $if[$splitText[3]==FirstPage]
  187.             $var[final.point;$multi[1;10]]
  188.             $var[updated.page;1]
  189.         $elseif[$splitText[3]==LastPage]
  190.                 $var[final.point;$multi[$var[total.pages];10]]
  191.                 $var[updated.page;$var[total.pages]]
  192.         $elseif[$splitText[3]==PrevPage]
  193.                 $var[final.point;$multi[$sub[$var[current.page];1];10]]
  194.                 $var[updated.page;$sub[$var[current.page];1]]
  195.         $elseif[$splitText[3]==NextPage]
  196.             $var[final.point;$multi[$sum[$var[current.page];1];10]]
  197.             $var[updated.page;$sum[$var[current.page];1]]
  198.         $endif
  199.        
  200.         $if[$or[$var[updated.page]>$var[total.pages];$var[updated.page]<=0]==true]
  201.             $var[final.point;$multi[$var[total.pages];10]]
  202.             $var[updated.page;$var[total.pages]]
  203.         $endif
  204.        
  205.         $var[q;$sub[$sub[$var[final.point];9];1]]
  206.         $var[sep;$url[decode;%0A]]
  207.         $var[users;$eval[$repeatMessage[10;%{DOL}%if[%{DOL}%json[details\;%{DOL}%var[q\]\]!=\]%{DOL}%sum[%{DOL}%var[q\]\;1\]. %{DOL}%var[get.user\;%{DOL}%json[details\;%{DOL}%var[q\]\;user\;id\]\]<@%{DOL}%var[get.user\]> ***(@%{DOL}%username[%{DOL}%var[get.user\]\])***%{DOL}%var[reason\;%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%json[details\;%{DOL}%var[q\]\;reason\]\;`\;\]\;%{DOL}%var[sep\]\; \]\] - %{DOL}%trimSpace[%{DOL}%if[%{DOL}%var[reason\]==\]`No reason given.`%{DOL}%else `%{DOL}%var[reason\]`%{DOL}%endif\]%{DOL}%var[sep\]%{DOL}%else %{DOL}%stop%{DOL}%endif%{DOL}%var[q\;%{DOL}%calculate[%{DOL}%var[q\] + 1\]\]]]]
  208.         $authorIcon[$serverIcon[$guildID]]
  209.         $author[$serverName[$guildID]]
  210.         $title[Banned Users ($var[details.length])]
  211.         $description[$var[users]]
  212.         $footer[Page $var[updated.page]/$var[total.pages]] $c[ // <- Do not edit the footer ]
  213.         $color[$var[color]]
  214.        
  215.         $addButton[false;GuildUsersBanList-$authorID-FirstPage;;primary;$checkCondition[$var[updated.page]==1];$var[first.page.arrow]]
  216.         $addButton[false;GuildUsersBanList-$authorID-PrevPage;;primary;$checkCondition[$var[updated.page]==1];$var[prev.page.arrow]]
  217.         $addButton[false;GuildUsersBanList-$authorID-NextPage;;primary;$checkCondition[$var[total.pages]==$var[updated.page]];$var[next.page.arrow]]
  218.         $addButton[false;GuildUsersBanList-$authorID-LastPage;;primary;$checkCondition[$var[total.pages]==$var[updated.page]];$var[last.page.arrow]]
  219.         $addButton[false;DeleteEmbedMsg-$authorID;;danger;false;$var[red.cross]]
  220.         $addButton[true;ServerBannedUser-$authorID;Search a User;secondary;false;👤]
  221.         $addButton[false;ServerBanListPage-$authorID;A Specific Page;secondary;false;📝]
  222.     $else
  223.         $ephemeral
  224.         $removeAllComponents
  225.         This is not your button!
  226.     $endif
  227. $endif
  228.  
  229. $if[$splitText[1]==DeleteEmbedMsg]
  230.     $if[$splitText[2]==$authorID]
  231.         $var[RepliedMessageID;$repliedMessageID[$channelID;$messageID]]
  232.            $try
  233.               $if[$var[RepliedMessageID]==]
  234.                   $deleteMessage[$channelID;$messageID]
  235.               $else
  236.                   $deleteMessage[$channelID;$var[RepliedMessageID]]
  237.                   $deleteMessage[$channelID;$messageID]
  238.               $endif
  239.            $catch
  240.               $ephemeral
  241.               $removeAllComponents
  242.               $description[I do not have `Manage Messages` Permissions!]
  243.               $color[#7afefb]
  244.            $endtry
  245.     $else
  246.         $ephemeral
  247.         $removeAllComponents
  248.         This is not your button!
  249.     $endif
  250. $endif
  251.  
Tags: BDFD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement