aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-31 19:28:02 +0300
committerGravatar ks123 <[email protected]>2020-03-31 19:28:02 +0300
commit7954c7503f9758eb2a1051a608da386cbef70364 (patch)
tree56007e2e829396419308d52b708cde15fdbb730f
parent(Infraction Edit): Don't let change expiration when infraction already expired. (diff)
(Infraction Edit): Don't change infraction when user try modify duration of infraction that is already expired and reason not specified.
-rw-r--r--bot/cogs/moderation/management.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index 531bb1743..6c68d852e 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -101,6 +101,11 @@ class ModManagement(commands.Cog):
log_text = ""
if duration is not None and not old_infraction['active']:
+ if reason is None:
+ await ctx.send(
+ "Expiry can't be changed (infraction already expired) and new reason not specified."
+ )
+ return
confirm_messages.append("expiry unchanged (infraction already expired)")
elif isinstance(duration, str):
request_data['expires_at'] = None