Advertisement
KingOfGamesss

Untitled

Aug 23rd, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. function sendEmbed(embed: embed builder, channel: channel, message: message):
  2. set {_m} to a message builder
  3. set embed of {_m} to {_embed}
  4. send {_m} to {_channel} with "StormMC" and store it in {_msg}
  5. add reaction "x" to {_msg} with "StormMC"
  6. set {StormMC.%{_msg}%} to {_message}
  7.  
  8. discord command tempmute <member> [<string>] [<timespan>]:
  9. description: <STAFF>Temporarily mute a user by ID or by a direct mention, must include a timespan and a reason.
  10. usage: tempmute <user id|direct mention|name##discriminator> <reason> <timespan>
  11. prefixes: {@prefix}
  12. executable in: guild
  13. bots: {@bot}
  14. trigger:
  15. if event-member is staff:
  16. if arg-2 is not set:
  17. needReason(event-message, event-channel)
  18. stop
  19. if arg-3 is not set:
  20. sendMessage("You must include a amount of time to mute the user for", event-channel, event-message)
  21. stop
  22. set {_roles::*} to roles of arg-1
  23. if {_roles::*} contains {mutedRole}:
  24. sendMessage("That user is already muted", event-channel, event-message)
  25. stop
  26. add {mutedRole} to roles of arg-1
  27. set {_error} to the last vixio error
  28. if permCheck({_error}):
  29. sendMessage("I ran into an error! `%{_error}%`", event-channel, event-message)
  30. stop
  31. if {punishment::tempmute::%arg-1%::count} is not set:
  32. set {punishment::tempmute::%arg-1%::count} to 1
  33. else:
  34. add 1 to {punishment::tempmute::%arg-1%::count}
  35. set {_count} to {punishment::tempmute::%arg-1%::count}
  36. set {punishment::tempmute::%arg-1%::%{_count}%::reason} to arg-2
  37. set {punishment::tempmute::%arg-1%::%{_count}%::length} to arg-3
  38. set {tempMute::%arg-1%} to arg-1
  39. set {tempMute::%arg-1%::length} to arg-3
  40. set {tempMute::%arg-1%::time} to now
  41. set {evaders::%arg-1%} to true
  42. send "You have been temporarily muted for `%arg-2%`, the length of the temp mute is `%arg-3%`." to arg-1 with event-bot
  43. sendMessage("I have successfully muted %arg-1%##%discriminator of arg-1% for %arg-3%", event-channel, event-message)
  44. set {_m} to a new message builder
  45. append line "**-=Temp-Mute=-**" to {_m}
  46. append line "**User**: %arg-1%##%discriminator of arg-1% (%id of arg-1%)" to {_m}
  47. append line "**Reason**: %arg-2%" to {_m}
  48. append line "**Amount of time**: %arg-3%" to {_m}
  49. append line "**Responsible Moderator**: %event-user%##%discriminator of event-user%" to {_m}
  50. sendLog({_m}
  51.  
  52. # Event to un-mute people who are temp-muted
  53. every minute:
  54. loop {tempMute::*}:
  55. set {_length} to {tempMute::%loop-index%::length}
  56. set {_time} to {tempMute::%loop-index%::time}
  57. set {_difference} to "%difference between {_time} and now%"
  58. if difference between {tempMute::%loop-index%::time} and now is more than {tempMute::%loop-index%::length}:
  59. wait 3 seconds
  60. remove {mutedRole} from roles of {tempMute::%loop-index%} in guild of {channel} with "StormMC"
  61. delete {tempMute::%loop-index%::*}
  62. delete {tempMute::%loop-index%}
  63. delete {evaders::%loop-index%}
  64. loop discord members of {guild}:
  65. delete {_roles::*}
  66. if bot state of loop-member is false:
  67. set {_roles::*} to roles of loop-member
  68. if {_roles::*} is not set:
  69. add 1 to {_count}
  70. add {whiteIsBoring} to roles of loop-member with "StormMC"
  71. else if {_roles::*} does not contain {whiteIsBoring}:
  72. add 1 to {_count}
  73. add {whiteIsBoring} to roles of loop-member with "StormMC"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement