From 9f3bcc57d06db73b0aeeeb0959431531ceafd46a Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sat, 15 Feb 2020 19:00:20 -0800 Subject: Moderation: show correct actor in expired infraction log The bot user was always being used instead of using the actor field of the infraction. --- bot/cogs/moderation/scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/cogs/moderation/scheduler.py b/bot/cogs/moderation/scheduler.py index 6a0ed71a0..e3edc960b 100644 --- a/bot/cogs/moderation/scheduler.py +++ b/bot/cogs/moderation/scheduler.py @@ -309,20 +309,21 @@ class InfractionScheduler(Scheduler): guild = self.bot.get_guild(constants.Guild.id) mod_role = guild.get_role(constants.Roles.moderator) user_id = infraction["user"] + actor = infraction["actor"] type_ = infraction["type"] id_ = infraction["id"] inserted_at = infraction["inserted_at"] expiry = infraction["expires_at"] + log.info(f"Marking infraction #{id_} as inactive (expired).") + 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).") - log_content = None log_text = { "Member": str(user_id), - "Actor": str(self.bot.user), + "Actor": str(self.bot.get_user(actor) or actor), "Reason": infraction["reason"], "Created": created, } -- cgit v1.2.3