Advertisement
FusionX88

Moderation CMD

Feb 8th, 2023
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.61 KB | None | 0 0
  1. $nomention
  2. $defer
  3.  
  4. $enabled[yes;Command is disabled...for now.]
  5.  
  6.  
  7. $var[user;$findUser[$message[user];yes]]
  8.  
  9. $title[**/// Attempting**]
  10. $description[Attempting to *$message[type]* $username[$var[user]]#$discriminator[$var[user]] for $message[reason]...]
  11. $color[#2f3135]
  12.  
  13.  
  14. $var[title;a]
  15. $var[description;a]
  16. $var[dms;no]
  17. $var[errCode;0]
  18. $var[timestamp;0]
  19.  
  20. $if[$authorID!=$serverOwner]
  21. $if[$rolePosition[$highestRole[$var[user]]]<=$rolePosition[$highestRole[$authorID]]]
  22.  
  23.   $title[**/// Insufficient Permissions**]
  24.   $description[The user, <@$var[user]> has a higher rank than you and therefore can't receive Moderation.
  25. > $rolePosition[$highestRole[$var[user]]] < **$rolePosition[$highestRole[$authorID]]**]
  26.  $stop
  27. $endif
  28. $endif
  29.  
  30. $if[$isAdmin[$authorID]==false]
  31.  $title[**/// Insufficient Permissions**]
  32.  $description[You are not allowed to use the Moderation command because you are not an Administrator.
  33. > $rolePosition[$highestRole[$var[user]]] < **$rolePosition[$highestRole[$authorID]]**]
  34. $endif
  35.  
  36.  
  37. $if[$var[user]==$authorID]
  38.  $title[**/// Bruh**]
  39.  $description[If you don't like being here, you know you can just leave the server, *right?*]
  40.   $stop
  41. $endif
  42.  
  43. $async[time]
  44.  
  45. $try
  46.  
  47.   $if[$message[unit]==m]
  48.     $var[timestamp;$calculate[$message[duration]*60+$getTimestamp]]
  49.   $elseif[$message[unit]==h]
  50.     $var[timestamp;$calculate[$message[duration]*3600+$getTimestamp]]
  51.   $elseif[$message[unit]==d]
  52.     $var[timestamp;$calculate[$message[duration]*86400+$getTimestamp]]
  53.   $elseif[$message[unit]==w]
  54.     $var[timestamp;$calculate[$message[duration]*604800+$getTimestamp]]
  55.   $endif
  56.  
  57. $endtry
  58.  
  59. $endasync
  60.  
  61. $await[time]
  62.  
  63. $try
  64.  
  65. $c[yep, error checking this whole thing aaaaaaaaa]
  66.  
  67. $if[$message[type]==warn]
  68.   $c[warned]
  69. $if[$isUserDMEnabled[$var[user]]==true]
  70.  
  71. $sendEmbedMessage[$dmChannelID[$var[user]];$c[content];
  72. **/// WARNING**;$c[url];
  73. You were warned in **$serverName[$guildID]**.
  74. > Moderator: <@$authorID>
  75. > Reason: $message[reason];#2f3135;$c[author];$c[author icon];$c[footer];$c[footer icon];$c[thumbnail];$c[image];yes;no]
  76.  
  77. $var[dms;yes]
  78.  
  79. $else
  80.  
  81. $title[**/// ERROR**]
  82.   $description[The User, <@$var[user]> doesn't have DMs enabled. Therefore, the warn will have no effect.
  83. > You can define a channel to send the Moderation Logs to as a fallback solution. soonᵗᵐ]
  84.  $stop
  85.  
  86. $endif
  87.  
  88. $elseif[$message[type]==timeout]
  89.  
  90. $timeout[$message[duration]$message[unit];$var[user]]
  91.  
  92. $if[$isUserDMEnabled[$var[user]]==true]
  93.  $c[timeout]
  94. $sendEmbedMessage[$dmChannelID[$var[user]];$c[content];
  95. **/// TIMED OUT**;$c[url];
  96. You were timed out in **$serverName[$guildID]**.
  97. > Moderator: <@$authorID>
  98. > Reason: $message[reason]
  99. > Length: $message[duration]$message[unit]
  100. > Expires: <t:$var[timestamp]:R>
  101. ;#2f3135;$c[author];$c[author icon];$c[footer];$c[footer icon];$c[thumbnail];$c[image];yes;no]
  102.  
  103. $var[dms;yes]
  104.  
  105. $endif
  106.  
  107. $elseif[$message[type]==kick]
  108.  
  109. $kick[$var[user]]
  110.  
  111.  $c[kick]
  112. $if[$isUserDMEnabled[$var[user]]==true]
  113. $sendEmbedMessage[$dmChannelID[$var[user]];$c[content];
  114. **/// KICKED**;$c[url];
  115. You were kicked from **$serverName[$guildID]**.
  116. > Moderator: <@$authorID>
  117. > Reason: $message[reason]
  118. ;#2f3135;$c[author];$c[author icon];$c[footer];$c[footer icon];$c[thumbnail];$c[image];yes;no]
  119.  
  120. $var[dms;yes]
  121.  
  122. $endif
  123.  
  124. $elseif[$message[type]==ban]
  125.  
  126. $banID[$message[reason];$var[user]]
  127.  
  128.  $c[ban]
  129. $if[$isUserDMEnabled[$var[user]]==true]
  130. $sendEmbedMessage[$dmChannelID[$var[user]];$c[content];
  131. **/// BANNED**;$c[url];
  132. You were banned from **$serverName[$guildID]**.
  133. > Moderator: <@$authorID>
  134. > Reason: $message[reason]
  135. ;#2f3135;$c[author];$c[author icon];$c[footer];$c[footer icon];$c[thumbnail];$c[image];yes;no]
  136.  
  137. $var[dms;yes]
  138. $endif
  139.  
  140.  
  141. $elseif[$message[type]==untimeout]
  142.  
  143.  $c[untimeout]
  144.  
  145.  $if[$isUserDMEnabled[$var[user]]==true]
  146.  $sendEmbedMessage[$dmChannelID[$var[user]];$c[content];
  147. **/// TIMEOUT REMOVED**;$c[url];
  148. You were removed from timeout in **$serverName[$guildID]**.
  149. > Moderator: <@$authorID>
  150. > Reason: $message[reason]
  151. ;#2f3135;$c[author];$c[author icon];$c[footer];$c[footer icon];$c[thumbnail];$c[image];yes;no]
  152.  
  153.  $var[dms;yes]
  154. $endif
  155.  
  156. $endif
  157.  
  158.  
  159.  
  160. $catch
  161.  
  162. $title[**/// ERROR**]
  163. $description[A fatal error occurred while $message[type]ing $username[$var[user]]#$discriminator[$var[user]].
  164.  
  165. **Function** `$error[command]` **returned an error at** `$error[row]:$error[column]` **with the following:**
  166. ```css
  167. $error[message]
  168. ```]
  169.  
  170.  
  171.  
  172. $stop
  173.  
  174. $endtry
  175.  
  176.  
  177. $title[**/// Success**]
  178.  
  179. $if[$message[type]==warn]
  180.  $c[warned]
  181.  $description[Successfully *warned* $username[$var[user]]#$discriminator[$var[user]] for the following:
  182. > $message[reason]]
  183. $elseif[$message[type]==timeout]
  184.  $c[timeout]
  185.  $description[Successfully *timed out* $username[$var[user]]#$discriminator[$var[user]] for the following:
  186. > $message[reason]
  187. > Time Issued: $message[duration]$message[unit]
  188. > Expires <t:$var[timestamp]:R>]
  189. $elseif[$message[type]==kick]
  190.  $c[kick]
  191.  $description[Successfully *kicked* $username[$var[user]]#$discriminator[$var[user]] for the following:
  192. > $message[reason]]
  193. $elseif[$message[type]==ban]
  194.  $c[ban]
  195.  $description[Successfully *banned* $username[$var[user]]#$discriminator[$var[user]] for the following:
  196. > $message[reason]]
  197. $elseif[$message[type]==untimeout]
  198.  $c[untimeout]
  199.  $description[Successfully removed the *timeout* for $username[$var[user]]#$discriminator[$var[user]] for the following:
  200. > $message[reason]]
  201. $endif
  202.  
  203. $thumbnail[$userAvatar[$var[user]]]
  204.  
  205. $if[$var[dms]==no]
  206.  
  207. $footer[The DM to $username[$var[user]] failed. This may be due to the user being a bot or the user turning off their DMs.]
  208.  
  209. $endif
  210.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement