diff options
author | 2021-07-15 22:25:16 -0700 | |
---|---|---|
committer | 2021-07-15 22:25:16 -0700 | |
commit | 786b690fab9812e0bda5296d5ea64e2c3cb446d3 (patch) | |
tree | 5f82ad7bcd8bb1955f40a4c6ae51ab52efc8d845 | |
parent | Allow manual mutes to override auto mutes (diff) |
Display error if overriding mute fails
-rw-r--r-- | bot/exts/moderation/infraction/infractions.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py index 1b1414ec7..eaf718af4 100644 --- a/bot/exts/moderation/infraction/infractions.py +++ b/bot/exts/moderation/infraction/infractions.py @@ -286,7 +286,13 @@ class Infractions(InfractionScheduler, commands.Cog): return # Let the current mute attempt override an automatically triggered mute. - await self.deactivate_infraction(active) + log_text = await self.deactivate_infraction(active) + if "Failure" in log_text: + await ctx.send( + f":x: can't override infraction **mute** for {user.mention}: " + f"failed to deactivate. {log_text['Failure']}" + ) + return infraction = await _utils.post_infraction(ctx, user, "mute", reason, active=True, **kwargs) if infraction is None: |