diff options
author | 2021-04-18 22:17:27 +0100 | |
---|---|---|
committer | 2021-04-18 22:17:27 +0100 | |
commit | 7fc5e37ecd2e1589b77b7fa16af26ee42e72dcdc (patch) | |
tree | 5ee24a9b4390c4f11d0cdfcb4f08a0d9bad11417 | |
parent | Make duration an optional arg and default it to 1 hour (diff) |
Check if a duration was provided
-rw-r--r-- | bot/exts/moderation/infraction/superstarify.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/moderation/infraction/superstarify.py b/bot/exts/moderation/infraction/superstarify.py index 8a6d14d41..f5d6259cd 100644 --- a/bot/exts/moderation/infraction/superstarify.py +++ b/bot/exts/moderation/infraction/superstarify.py @@ -136,8 +136,9 @@ class Superstarify(InfractionScheduler, Cog): return # Set the duration to 1 hour if none was provided - duration = datetime.datetime.now() + datetime.timedelta(hours=1) - + if not duration: + duration = datetime.datetime.now() + datetime.timedelta(hours=1) + # Post the infraction to the API old_nick = member.display_name infraction_reason = f'Old nickname: {old_nick}. {reason}' |