diff options
author | 2020-02-15 18:40:54 -0800 | |
---|---|---|
committer | 2020-02-15 18:43:33 -0800 | |
commit | 2a655699b5e387a3854472210c5bf6ee95d076cc (patch) | |
tree | 5fddf18060ee4f9cb07f7e135c556c7cd5e65aff | |
parent | Utils: refactor format_infraction_with_duration and support absolute val (diff) |
Moderation: add creation date & duration to expired infraction log
Closes #685
-rw-r--r-- | bot/cogs/moderation/scheduler.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/cogs/moderation/scheduler.py b/bot/cogs/moderation/scheduler.py index e14c302cb..6a0ed71a0 100644 --- a/bot/cogs/moderation/scheduler.py +++ b/bot/cogs/moderation/scheduler.py @@ -311,6 +311,11 @@ class InfractionScheduler(Scheduler): user_id = infraction["user"] type_ = infraction["type"] id_ = infraction["id"] + inserted_at = infraction["inserted_at"] + expiry = infraction["expires_at"] + + expiry = dateutil.parser.isoparse(expiry).replace(tzinfo=None) if expiry else None + created = time.format_infraction_with_duration(inserted_at, expiry) log.info(f"Marking infraction #{id_} as inactive (expired).") @@ -318,7 +323,8 @@ class InfractionScheduler(Scheduler): log_text = { "Member": str(user_id), "Actor": str(self.bot.user), - "Reason": infraction["reason"] + "Reason": infraction["reason"], + "Created": created, } try: |