diff options
author | 2021-10-06 15:09:08 +0100 | |
---|---|---|
committer | 2021-10-06 15:09:08 +0100 | |
commit | 53e3d2267a71779787f8a9cb23806947beb26918 (patch) | |
tree | da1ccd1e7640b60559f09444232d78f53579e331 | |
parent | Merge pull request #1859 from python-discord/revert-1806-infract-then-dm (diff) |
Distinguish between note/warning and expired infraction in error message
-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") |