-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[Mutes] Catch failure to add or remove role #5467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: V3/develop
Are you sure you want to change the base?
Conversation
| if guild.id in self._server_mutes: | ||
| if user.id in self._server_mutes[guild.id]: | ||
| del self._server_mutes[guild.id][user.id] | ||
| if guild.id in self._server_mutes and user.id in self._server_mutes[guild.id]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if statement changed to match the one in mute_user
99a4f47 to
7c99a78
Compare
redbot/cogs/mutes/mutes.py
Outdated
| if not guild.me.guild_permissions.manage_roles or role >= guild.me.top_role: | ||
| ret["reason"] = _(MUTE_UNMUTE_ISSUES["permissions_issue_role"]) | ||
| return ret | ||
| if role in user.roles: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Jack stated in #5161 we should care more about [p]unmute not so much [p]mute. This would prevent updating a mute duration forcing the user to unmute and then re-apply the mute which is inconvenient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you make a good point.
add_roles won't fail if the user already has the role and since the user is already muted the user gets what they expected.
It might be worthwhile to add a message for updating the mute duration and printing out already muted if none is given, but this is not the point of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7c99a78 to
7021e5b
Compare

Closes #5161
Alternative of #5345
Description of the changes
catches
discord.errors.HTTPExceptionthrown by add_roles and remove_roles and states the user is already (un)muted