Add mute command
Closed this issue · 2 comments
-mute <@user>
Prevents the user from talking in all channels
-mute <@user> <#channel>
Prevents the user from talking in a single channel
-unmute <@user>
same as -mute <@user>
but in reverse
-unmute <@user> <#channel>
same as -mute <@user> <#channel>
but in reverse
Also maybe a -voice_mute
command or something to server mute a user in voice
Need to figure out how these play into mod_log.
Honestly I can't figure out a good way to implement this. The primary issue is that both the addition of a mute role that doesn't have access to talking in channels, and keeping that role up to date with permissions isn't something that can be done consistently in a neat manner. I might come back to this at a later date, but for now it is in limbo unless someone can figure this out.
Something like this maybe:
new table muted
with keys userid, guildid, channelid, previousperms
then loop through all channels
if the muted role is in them then
determine int value of user perms in that channel
explicitely deny read perms for user and add to db
for unmute
gather list of all channels in db that matches userid and guidid
restore perms to previous
muting should take longer than unmuting.