diff options
author | 2021-10-14 21:02:43 +0100 | |
---|---|---|
committer | 2021-10-14 21:02:43 +0100 | |
commit | cf4533d451ecd58008d2dcbb85c3a66018665218 (patch) | |
tree | 503f23008435c971cbac267c7d212b87602cfea9 | |
parent | Merge pull request #1836 from python-discord/tags-revision (diff) | |
parent | Merge branch 'main' into solve-bot-1852 (diff) |
Merge pull request #1861 from python-discord/solve-bot-1852
Distinguish between note/warning and expired infraction
-rw-r--r-- | bot/exts/moderation/infraction/management.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py index 0cb2a8b60..dd44f7dd0 100644 --- a/bot/exts/moderation/infraction/management.py +++ b/bot/exts/moderation/infraction/management.py @@ -141,10 +141,11 @@ class ModManagement(commands.Cog): log_text = "" if duration is not None and not infraction['active']: - if reason is None: + if (infr_type := infraction['type']) in ('note', 'warning'): + await ctx.send(f":x: Cannot edit the expiration of a {infr_type}.") + else: await ctx.send(":x: Cannot edit the expiration of an expired infraction.") - return - confirm_messages.append("expiry unchanged (infraction already expired)") + return elif isinstance(duration, str): request_data['expires_at'] = None confirm_messages.append("marked as permanent") |