Advertisement
Aouchan

/warn-log's Interaction Code

Feb 26th, 2024
1,228
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 14.92 KB | Source Code | 1 0
  1. Trigger: $onInteraction
  2.  
  3. $nomention
  4.  
  5. $textSplit[$customID;-]
  6.  
  7. $if[$splitText[1]==warnLogs]
  8.     $if[$splitText[2]==$authorID]
  9.         $var[color;4ac1e4]
  10.         $var[excla;❕]
  11.        
  12.         $if[$or[$checkUserPerms[$authorID;moderatemembers]==true;$isAdmin[$authorID]==true]==false]
  13.             $ephemeral
  14.             $removeAllComponents
  15.             $var[excla] You do not have required permissions to run this command!
  16.         $else
  17.             $var[get-user;$splitText[3]]  
  18.             $jsonParse[$getUserVar[userWarns.json;$var[get-user]]]
  19.            
  20.             $if[$or[$json[infractions]==[\];$jsonExists[infractions]==false]==true]
  21.                 $ephemeral
  22.                 $removeAllComponents
  23.                 $description[$var[excla] <@$splitText[3]> has no warnings]
  24.                 $color[$var[color]]
  25.             $else
  26.                 $var[infractions.length;$jsonArrayCount[infractions]]
  27.            
  28.                 $async[OwO]
  29.                    $textSplit[$replaceText[$getEmbedData[$channelID;$messageID;1;footer];Page;];/]
  30.                    $var[fetched.current.page;$splitText[1]]
  31.                
  32.                    $enableDecimals[true]
  33.                    $var[div;$divide[$var[infractions.length];4]]
  34.    
  35.                    $if[$checkContains[$var[div];.]==true]
  36.                        $textSplit[$var[div];.]
  37.                        $var[total.pages;$sum[$splitText[1];1]]
  38.                    $else
  39.                        $var[total.pages;$var[div]]
  40.                    $endif
  41.                 $endasync $await[OwO]
  42.            
  43.                 $if[$splitText[4]==firstpage]
  44.                     $var[updated.page;1]
  45.                 $elseif[$splitText[4]==prevpage]
  46.                     $var[updated.page;$sub[$var[fetched.current.page];1]]      
  47.                 $elseif[$splitText[4]==nextpage]
  48.                     $var[updated.page;$sum[$var[fetched.current.page];1]]
  49.                 $elseif[$splitText[4]==lastpage]
  50.                     $var[updated.page;$var[total.pages]]
  51.                 $endif
  52.                
  53.                 $if[$or[$var[updated.page]>$var[total.pages];$var[updated.page]<=0]==true]
  54.                     $var[updated.page;$var[total.pages]]
  55.                 $endif
  56.                
  57.                 $var[newline.space;$url[decode;%0A+]]
  58.                 $var[newline;$url[decode;%0A]]
  59.                 $var[n;$sub[$multi[$var[updated.page];4];3]]
  60.                 $var[q;$sub[$var[n];1]]
  61.                
  62.                 $var[time.emoji;`⏰`]
  63.                 $var[id.emoji;`🆔`]
  64.                 $var[reason.emoji;`📜`]
  65.    
  66.                 $var[loop;%{DOL}%if[%{DOL}%json[infractions\;%{DOL}%var[q\]\]!=\]%{DOL}%var[n\]. **Moderator:** <@%{DOL}%json[infractions\;%{DOL}%var[q\]\;moderator\;id\]> `(%{DOL}%json[infractions\;%{DOL}%var[q\]\;moderator\;name\])`%{DOL}%var[newline.space\]- %{DOL}%var[reason.emoji\] Reason: %{DOL}%async[%{DOL}%var[q\]\]%{DOL}%jsonParse[{ "text": "%{DOL}%json[infractions\;%{DOL}%var[q\]\;reason\]" }\]%{DOL}%var[r.text\;%{DOL}%json[text\]\]%{DOL}%endasync%{DOL}%await[%{DOL}%var[q\]\]%{DOL}%var[r.text\]%{DOL}%var[newline.space\]- %{DOL}%var[time.emoji\] Time: <t:%{DOL}%json[infractions\;%{DOL}%var[q\]\;timestamp\]> (<t:%{DOL}%json[infractions\;%{DOL}%var[q\]\;timestamp\]:R>)%{DOL}%var[newline.space\]- %{DOL}%var[id.emoji\] WarnID: %{DOL}%json[infractions\;%{DOL}%var[q\]\;warnID\]%{DOL}%var[newline\]%{DOL}%var[n\;%{DOL}%calculate[%{DOL}%var[n\]+1\]\]%{DOL}%endif%{DOL}%var[q\;%{DOL}%calculate[%{DOL}%var[q\]+1\]\]]
  67.                 $var[warnings;$eval[$repeatMessage[4;$var[loop]]]]
  68.                
  69.                 $title[*This user has $var[infractions.length] Warnings*]
  70.                 $description[$var[warnings]$var[newline]$var[newline]Total Warnings Issued: $json[total-warns]]              
  71.                 $thumbnail[$userServerAvatar[$var[get-user]]]
  72.                 $footer[Page $var[updated.page]/$var[total.pages]]
  73.                 $color[$var[color]]
  74.                
  75.                 $var[first-arrow;<:Pixelated_FirstArrow:1193452503589716078>]
  76.                 $var[prev-arrow;<:Pixelated_PrevArrow:1193452525832126464>]
  77.                 $var[next-arrow;<:Pixelated_NextArrow:1193452428230672435>]
  78.                 $var[last-arrow;<:Pixelated_LastArrow:1193452401831710720>]
  79.                 $var[cross-button;<:VN_RedCross:1068802990657519686>]
  80.                 $var[arrow.buttons.color;secondary]
  81.                
  82.                 $removeAllComponents
  83.                 $addButton[false;warnLogs-$authorID-$var[get-user]-firstpage;;$var[arrow.buttons.color];$checkCondition[$var[updated.page]==1];$var[first-arrow]]
  84.                 $addButton[false;warnLogs-$authorID-$var[get-user]-prevpage;;$var[arrow.buttons.color];$checkCondition[$var[updated.page]==1];$var[prev-arrow]]
  85.                 $addButton[false;warnLogs-$authorID-$var[get-user]-nextpage;;$var[arrow.buttons.color];$checkCondition[$var[updated.page]>=$var[total.pages]];$var[next-arrow]]
  86.                 $addButton[false;warnLogs-$authorID-$var[get-user]-lastpage;;$var[arrow.buttons.color];$checkCondition[$var[updated.page]>=$var[total.pages]];$var[last-arrow]]
  87.                 $addButton[false;vani-$authorID;;danger;no;$var[cross-button]]
  88.                
  89.                 $var[x;$sub[$multi[$var[updated.page];4];3]]
  90.                 $var[p;$sub[$var[x];1]]
  91.                 $var[warn.ids.style.button;secondary]
  92.                
  93.                 $eval[$repeatMessage[4;%{DOL}%if[%{DOL}%json[infractions\;%{DOL}%var[p\]\]!=\]%{DOL}%addButton[%{DOL}%checkCondition[$var[p]==%{DOL}%var[p\]\]\;user.warn.id-%{DOL}%authorID-%{DOL}%json[infractions\;%{DOL}%var[p\]\;warnID\]\;%{DOL}%var[x\]\;%{DOL}%var[warn.ids.style.button\]\;false\;🆔\]%{DOL}%var[x\;%{DOL}%calculate[%{DOL}%var[x\]+1\]\]%{DOL}%endif%{DOL}%var[p\;%{DOL}%calculate[%{DOL}%var[p\]+1\]\]]]
  94.                
  95.                 $addButton[true;deleteWarn-$authorID-All-$var[get-user];Clear all warnings;primary;false]
  96.                 $addButton[false;deleteWarn-$authorID-Specific-$var[get-user];Clear a specific warning;primary;false]
  97.             $endif $c[ <- Infractions empty check ]  
  98.         $endif $c[ <- User's moderateMembers/Admin Perms check end ]
  99.    $else
  100.        $ephemeral
  101.        $removeAllComponents
  102.        not your button
  103.    $endif
  104. $endif
  105.  
  106. $if[$splitText[1]==deleteWarn]
  107.    $if[$splitText[2]==$authorID]
  108.        $var[excla;❕]
  109.            $if[$or[$checkUserPerms[$authorID;moderatemembers]==true;$isAdmin[$authorID]==true]==false]
  110.                $ephemeral
  111.                $removeAllComponents
  112.                $var[excla] You do not have required permissions to run this command!
  113.            $else
  114.                $jsonParse[$getUserVar[userWarns.json;$splitText[4]]]
  115.                   $if[$or[$jsonExists[infractions]==false;$json[infractions]==[\]]==true]
  116.                       $ephemeral
  117.                       $removeAllComponents
  118.                       That user has no warnings!
  119.                   $else
  120.                       $if[$splitText[3]==All]
  121.                           $ephemeral
  122.                           $removeAllComponents
  123.                           $var[color;4ac1e4]
  124.            
  125.                           $title[Confirmation!]
  126.                           $description[Are you sure you want to clear all warnings for <@$splitText[4]> ?]
  127.                           $color[$var[color]]
  128.            
  129.                           $addButton[no;all.warnings.clear-true-$messageID-$splitText[4];Yes;danger;false]
  130.                           $addButton[no;all.warnings.clear-false-$messageID-$splitText[4];No;success;false]
  131.                       $elseif[$splitText[3]==Specific]
  132.                      
  133.                               $newModal[deleteWarn-$authorID-openModal-$splitText[4];Clear a warn]
  134.                               $addTextInput[warn~id;short;Enter a valid warn ID;7;40;true]
  135.                              
  136.                       $elseif[$splitText[3]==openModal]
  137.                               $ephemeral
  138.                               $removeAllComponents
  139.                              
  140.                               $var[warn_id;$input[warn~id]]
  141.                               $var[color;4ac1e4]
  142.                      
  143.                               $var[x;0]
  144.                               $var[loop;%{DOL}%if[%{DOL}%json[infractions\;%{DOL}%var[x\]\;warnID\]==%{DOL}%var[warn_id\]\]%{DOL}%var[found_warn_id\;%{DOL}%json[infractions\;%{DOL}%var[x\]\]\]%{DOL}%stop%{DOL}%endif%{DOL}%var[x\;%{DOL}%calculate[%{DOL}%var[x\]+1\]\]]
  145.                      
  146.                               $var[repeat;$replaceText[$cropText[$repeatMessage[10;$repeatMessage[10;z]];$jsonArrayCount[infractions];];z;$var[loop]]]
  147.                               $var[result;$eval[$var[repeat]]]
  148.                              
  149.                               $var[time.emoji;`⏰`]
  150.                               $var[id.emoji;`🆔`]
  151.                               $var[reason.emoji;`📜`]
  152.                              
  153.                               $if[$var[found_warn_id]==]
  154.                                   Warn ID `$var[warn_id]` not found for <@$splitText[4]> ($username[$splitText[4]])
  155.                               $else
  156.                                   $title[Are you sure you want to remove this warn?]
  157.                                   $description[- **Moderator**: <@$json[infractions;$var[x];moderator;id]> ($json[infractions;$var[x];moderator;name])$url[decode;%0A+]- $var[reason.emoji] Reason:$async[]$jsonParse[{ "text": "$json[infractions;$var[x];reason]" }]$var[r.text;$json[text]]$endasync $await[]$var[r.text]$url[decode;%0A+]- $var[time.emoji] Time: <t:$json[infractions;$var[x];timestamp]> (<t:$json[infractions;$var[x];timestamp]:R>)$url[decode;%0A+]- $var[id.emoji] WarnID: $json[infractions;$var[x];warnID]]
  158.                                   $color[$var[color]]
  159.                                  
  160.                                   $addButton[no;specify.warning.clear-true-$var[x]-$splitText[4]-$messageID;Yes;danger;false]
  161.                                   $addButton[no;specify.warning.clear-false-$var[x]-$splitText[4]-$messageID;No;success;false]
  162.                               $endif                          
  163.                      $endif $c[ Delete-warn 3rd split end ]
  164.                  $endif $c[ <- infractions key check ]
  165.            $endif $c[ <- User Moderate/Admin Perm check ]
  166.    $else
  167.        $ephemeral
  168.        $removeAllComponents
  169.        not your button
  170.    $endif
  171. $endif
  172.  
  173. $if[$splitText[1]==all.warnings.clear]
  174.    $var[color;4ac1e4]
  175.    $var[tick;☑️]
  176.    
  177.    $if[$splitText[2]==true]
  178.        $jsonParse[$getUserVar[userWarns.json;$splitText[4]]]
  179.           $if[$or[$jsonExists[infractions]==false;$json[infractions]==[\]]==true]
  180.               $title[~~Confirmation!~~]
  181.               $description[~~Are you sure you want to clear all warnings for <@$splitText[4]> ?~~]            
  182.               $color[$var[color]]
  183.              
  184.               $description[That user has no warnings!;2]
  185.               $color[$var[color];2]
  186.           $else
  187.               $jsonUnset[infractions]
  188.               $setUserVar[userWarns.json;$jsonStringify;$splitText[4]]
  189.        
  190.               $removeAllComponents[$splitText[3]]
  191.               $editMessage[$channelID;$splitText[3];;;$var[tick] Cleared all warnings for <@$splitText[4]>;$var[color];]
  192.        
  193.               $title[~~Confirmation!~~]
  194.               $description[~~Are you sure you want to clear all warnings for <@$splitText[4]> ?~~]
  195.               $color[$var[color]]
  196.           $endif
  197.    $else
  198.        $title[~~Confirmation!~~]
  199.        $description[~~Are you sure you want to clear all warnings for <@$splitText[4]> ?~~]
  200.        $color[$var[color]]
  201.        
  202.        $description[Action cancelled;2]
  203.        $color[$var[color];2]
  204.    $endif
  205.    
  206.    $editButton[all.warnings.clear-true-$splitText[3]-$splitText[4];Yes;danger;true]
  207.    $editButton[all.warnings.clear-false-$splitText[3]-$splitText[4];No;success;true]
  208. $endif
  209.  
  210. $if[$splitText[1]==specify.warning.clear]
  211.    $var[color;4ac1e4]
  212.    $var[tick;☑️]
  213.    $var[time.emoji;`⏰`]
  214.    $var[id.emoji;`🆔`]
  215.    $var[reason.emoji;`📜`]
  216.    $var[mainMenu.msgID;$splitText[5]]
  217.    
  218.    $var[array.index;$splitText[3]]  
  219.    $jsonParse[$getUserVar[userWarns.json;$splitText[4]]]
  220.    
  221.    $if[$or[$jsonExists[infractions]==false;$json[infractions]==[\]]==true]
  222.        $description[<@$splitText[4]> has no warnings!]
  223.        $color[$var[color]]
  224.    $else
  225.        $if[$splitText[2]==true]
  226.            $title[~~Are you sure you want to remove this warn?~~]
  227.            $description[~~- **Moderator**: <@$json[infractions;$var[array.index];moderator;id]> ($json[infractions;$var[array.index];moderator;name])$url[decode;%0A+]- $var[reason.emoji] Reason:$async[]$jsonParse[{ "text": "$json[infractions;$var[array.index];reason]" }]$var[r.text;$json[text]]$endasync $await[]$var[r.text]$url[decode;%0A+]- $var[time.emoji] Time: <t:$json[infractions;$var[array.index];timestamp]> (<t:$json[infractions;$var[array.index];timestamp]:R>)$url[decode;%0A+]- $var[id.emoji] WarnID: $json[infractions;$var[array.index];warnID]~~]        
  228.            $color[$var[color]]
  229.            $var[removed.warn.id;$json[infractions;$var[array.index];warnID]]
  230.            
  231.            $jsonUnset[infractions;$var[array.index]]
  232.            $setUserVar[userWarns.json;$jsonStringify;$splitText[4]]
  233.        
  234.            $description[$var[tick] Successfully deleted this warning from <@$splitText[4]>;2]
  235.            $color[$var[color];2]
  236.            $editButton[user.warn.id-$authorID-$var[removed.warn.id];$sum[$var[array.index];1];secondary;true;🆔;$var[mainMenu.msgID]]
  237.        $else
  238.            $title[~~Are you sure you want to remove this warn?~~]
  239.            $description[~~- **Moderator**: <@$json[infractions;$var[array.index];moderator;id]> ($json[infractions;$var[array.index];moderator;name])$url[decode;%0A+]- $var[reason.emoji] Reason:$async[]$jsonParse[{ "text": "$json[infractions;$var[array.index];reason]" }]$var[r.text;$json[text]]$endasync $await[]$var[r.text]$url[decode;%0A+]- $var[time.emoji] Time: <t:$json[infractions;$var[array.index];timestamp]> (<t:$json[infractions;$var[array.index];timestamp]:R>)$url[decode;%0A+]- $var[id.emoji] WarnID: $json[infractions;$var[array.index];warnID]~~]        
  240.            $color[$var[color]]
  241.        
  242.            $description[Action Cancelled;2]
  243.            $color[$var[color];2]
  244.        $endif
  245.    $endif
  246.    
  247.    $editButton[specify.warning.clear-true-$splitText[3]-$splitText[4]-$splitText[5];Yes;danger;true]
  248.    $editButton[specify.warning.clear-false-$splitText[3]-$splitText[4]-$splitText[5];No;success;true]  
  249. $endif
  250.  
  251. $if[$splitText[1]==user.warn.id]
  252.    $if[$splitText[2]==$authorID]
  253.        $ephemeral
  254.        $removeAllComponents
  255.        $var[color;4ac1e4]
  256.        
  257.        $description[$splitText[3]]
  258.        $color[$var[color]]
  259.    $else
  260.        $ephemeral
  261.        $removeAllComponents
  262.        not your button
  263.    $endif
  264. $endif
  265.  
  266.  
Tags: BDFD
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement