diff options
author | 2021-04-18 22:11:46 +0100 | |
---|---|---|
committer | 2021-04-18 22:11:46 +0100 | |
commit | 3126e00a28e498afc8ecef1ed87b356f0e4a38c4 (patch) | |
tree | e700acfd5d52b1443e6ad3da15395458b09bfd16 | |
parent | Added default duration of 1h to superstarify (diff) |
Make duration an optional arg and default it to 1 hour
-rw-r--r-- | bot/exts/moderation/infraction/superstarify.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/moderation/infraction/superstarify.py b/bot/exts/moderation/infraction/superstarify.py index 245f14905..8a6d14d41 100644 --- a/bot/exts/moderation/infraction/superstarify.py +++ b/bot/exts/moderation/infraction/superstarify.py @@ -1,3 +1,4 @@ +import datetime import json import logging import random @@ -109,7 +110,7 @@ class Superstarify(InfractionScheduler, Cog): self, ctx: Context, member: Member, - duration: Expiry = "1h", + duration: t.Optional[Expiry], *, reason: str = '', ) -> None: @@ -134,6 +135,9 @@ class Superstarify(InfractionScheduler, Cog): if await _utils.get_active_infraction(ctx, member, "superstar"): return + # Set the duration to 1 hour if none was provided + 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}' |