Adds functionality for muting members. Muted members are unable to send messages or speak in voice channels, but are still able to read and hear what others are saying.
This is accomplished (because the API sucks) by making an "unmuted" role which is required to speak, removing speaking permissions from all other roles, and ensuring that only those who are not currently muted have the role. Members with a mod role have access to two new commands:
*mute \ \: Removes the unmuted role from the specified user and gives them a "muted" role which just colors their name red for aesthetic purposes. After have elapsed, the muted user will be unmuted as specified below. We do our best to respect this commitment. Restarting the bot will not prevent the user from being unmuted on time, and if the bot is offline when the time comes, the user will be unmuted as soon as the bot is back online. If a reason is provided, this is reflected in discord's log of the role modification. Member must be a mention. Time must be a number. Time units must be seconds ('seconds', 'second', or 's'), minutes ('minutes', 'minute', or 'm'), or hours ('hours', 'hour', or 'h'). Reason is just a string.
*unmute \: Unmutes the specified member. If they are not muted, it will do nothing except provide feedback in the channel from which it was invoked. If the member had a timed unmute pending (which they should), this is cancelled. The muted role is rescinded and the unmuted role granted back to the specified member, allowing them to once again speak and send messages.
In order to make this system work, the bot must ensure that:
All servers to which the bot is connected have a muted role and an unmuted role.
All users who are not muted have the unmuted role, as they will be unable to speak without it.
No other roles below the bot's level of authority grant speaking and message sending permissions, as this will render mutes ineffective.
To do this, it performs a sweep of all of the servers to which it is connected on startup and monitors for any new roles, changes to roles, or new members on any server, enforcing the above conditions.
Adds functionality for muting members. Muted members are unable to send messages or speak in voice channels, but are still able to read and hear what others are saying.
This is accomplished (because the API sucks) by making an "unmuted" role which is required to speak, removing speaking permissions from all other roles, and ensuring that only those who are not currently muted have the role. Members with a mod role have access to two new commands:
*mute \ \ : Removes the unmuted role from the specified user and gives them a "muted" role which just colors their name red for aesthetic purposes. After have elapsed, the muted user will be unmuted as specified below. We do our best to respect this commitment. Restarting the bot will not prevent the user from being unmuted on time, and if the bot is offline when the time comes, the user will be unmuted as soon as the bot is back online. If a reason is provided, this is reflected in discord's log of the role modification. Member must be a mention. Time must be a number. Time units must be seconds ('seconds', 'second', or 's'), minutes ('minutes', 'minute', or 'm'), or hours ('hours', 'hour', or 'h'). Reason is just a string.
*unmute \ : Unmutes the specified member. If they are not muted, it will do nothing except provide feedback in the channel from which it was invoked. If the member had a timed unmute pending (which they should), this is cancelled. The muted role is rescinded and the unmuted role granted back to the specified member, allowing them to once again speak and send messages.
In order to make this system work, the bot must ensure that:
To do this, it performs a sweep of all of the servers to which it is connected on startup and monitors for any new roles, changes to roles, or new members on any server, enforcing the above conditions.