Update role creation and completely refactor muting
Update new channel muting
I've refactored how the handling works. The role creation remains the same, and the same process still runs when a new channel is created. However, instead of updated channel overwrites every time the guildMemberUpdate event runs (which is every nickname change, role change of a user, etc.), it now runs just once when the role is created and creates permanent permission overrides for the On Mute role in all channels.
With the new update to threads, I've denied permissions for muted users to create or send messages in threads as well. They also cannot upload files or use slash commands.
When we upgrade the actual bot on the community server, this will necessitate completely removing the bot from the server, then re-adding it.
Any helpful knowledge/context for the reviewer?
Steps to Test
Remove your bot from the server.
Add your bot to the server with Administrator permissions.
Ensure that an On Mute role is created by the bot upon joining the server (if such a role does not already exist in the server).
Ensure that all channels have a permission override where the On Mute role cannot send text messages, send messages in threads, etc.
When new channels are created, they should also have the override mentioned in step 5.
Should not result in any other unexpected behaviour (muted users seeing private channels, etc.)
Is a re-seeding of the database necessary? No.
Any new dependencies to install? No.
Any special requirements to test? Need to be able to mute and unmute users.
(e.g., admin perms, alt account, etc.)
Please make sure you've attempted to meet the following coding standards
[x] Code has been tested and does not produce errors
[x] Code is readable and formatted
[x] There isn't any unnecessary commented-out code
What issue is this solving?
Closes #273 Closes #218
Description
I've refactored how the handling works. The role creation remains the same, and the same process still runs when a new channel is created. However, instead of updated channel overwrites every time the
guildMemberUpdate
event runs (which is every nickname change, role change of a user, etc.), it now runs just once when the role is created and creates permanent permission overrides for theOn Mute
role in all channels.With the new update to threads, I've denied permissions for muted users to create or send messages in threads as well. They also cannot upload files or use slash commands.
When we upgrade the actual bot on the community server, this will necessitate completely removing the bot from the server, then re-adding it.
Any helpful knowledge/context for the reviewer?
Steps to Test
On Mute
role is created by the bot upon joining the server (if such a role does not already exist in the server).On Mute
role cannot send text messages, send messages in threads, etc.Please make sure you've attempted to meet the following coding standards