Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- discord command tempmute <member> [<string>] [<timespan>]:
- description: <STAFF>Temporarily mute a user by ID or by a direct mention, must include a timespan and a reason.
- usage: tempmute <user id|direct mention|name##discriminator> <reason> <timespan>
- prefixes: .
- executable in: guild
- bots: StormMC
- trigger:
- if f event-member has role name "":
- if arg-2 is not set:
- needReason(event-message, event-channel)
- stop
- if arg-3 is not set:
- sendMessage("You must include a amount of time to mute the user for", event-channel, event-message)
- stop
- set {_roles::*} to roles of arg-1
- if {_roles::*} contains {mutedRole}:
- sendMessage("That user is already muted", event-channel, event-message)
- stop
- add {mutedRole} to roles of arg-1
- set {_error} to the last vixio error
- if permCheck({_error}):
- sendMessage("I ran into an error! `%{_error}%`", event-channel, event-message)
- stop
- if {punishment::tempmute::%arg-1%::count} is not set:
- set {punishment::tempmute::%arg-1%::count} to 1
- else:
- add 1 to {punishment::tempmute::%arg-1%::count}
- set {_count} to {punishment::tempmute::%arg-1%::count}
- set {punishment::tempmute::%arg-1%::%{_count}%::reason} to arg-2
- set {punishment::tempmute::%arg-1%::%{_count}%::length} to arg-3
- set {tempMute::%arg-1%} to arg-1
- set {tempMute::%arg-1%::length} to arg-3
- set {tempMute::%arg-1%::time} to now
- set {evaders::%arg-1%} to true
- send "You have been temporarily muted for `%arg-2%`, the length of the temp mute is `%arg-3%`." to arg-1 with event-bot
- sendMessage("I have successfully muted %arg-1%##%discriminator of arg-1% for %arg-3%", event-channel, event-message)
- set {_m} to a new message builder
- append line "**-=Temp-Mute=-**" to {_m}
- append line "**User**: %arg-1%##%discriminator of arg-1% (%id of arg-1%)" to {_m}
- append line "**Reason**: %arg-2%" to {_m}
- append line "**Amount of time**: %arg-3%" to {_m}
- append line "**Responsible Moderator**: %event-user%##%discriminator of event-user%" to {_m}
- sendLog({_m})
- # Event to un-mute people who are temp-muted
- every minute:
- loop {tempMute::*}:
- set {_length} to {tempMute::%loop-index%::length}
- set {_time} to {tempMute::%loop-index%::time}
- set {_difference} to "%difference between {_time} and now%"
- if difference between {tempMute::%loop-index%::time} and now is more than {tempMute::%loop-index%::length}:
- wait 3 seconds
- remove {mutedRole} from roles of {tempMute::%loop-index%} in guild of {channel} with "StormMC"
- delete {tempMute::%loop-index%::*}
- delete {tempMute::%loop-index%}
- delete {evaders::%loop-index%}
- loop discord members of {guild}:
- delete {_roles::*}
- if bot state of loop-member is false:
- set {_roles::*} to roles of loop-member
- if {_roles::*} is not set:
- add 1 to {_count}
- add {whiteIsBoring} to roles of loop-member with "StormMC"
- else if {_roles::*} does not contain {whiteIsBoring}:
- add 1 to {_count}
- add {whiteIsBoring} to roles of loop-member with "StormMC"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement