From 5459392d7e95a8a495bee42a3dd51013e04e6774 Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 23 Aug 2024 14:43:43 -0400 Subject: [PATCH] fix(aurora): update the autologger method to use the new type registry --- aurora/aurora.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 46d88e0..2e35ac7 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -46,7 +46,7 @@ class Aurora(commands.Cog): This cog stores all of its data in an SQLite database.""" __author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] - __version__ = "3.0.0-indev22" + __version__ = "3.0.0-indev23" __git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __documentation__ = "https://seacogs.coastalcommits.com/aurora/" @@ -189,13 +189,13 @@ class Aurora(commands.Cog): reason = "This action was performed without the bot." if entry.action == discord.AuditLogAction.kick: - moderation_type = "KICK" + moderation_type = type_registry['kick'] elif entry.action == discord.AuditLogAction.ban: - moderation_type = "BAN" + moderation_type = type_registry['ban'] elif entry.action == discord.AuditLogAction.unban: - moderation_type = "UNBAN" + moderation_type = type_registry['unban'] elif entry.action == discord.AuditLogAction.member_update: if entry.after.timed_out_until is not None: @@ -207,22 +207,22 @@ class Aurora(commands.Cog): ) minutes = round(duration_datetime.total_seconds() / 60) duration = timedelta(minutes=minutes) - moderation_type = "MUTE" + moderation_type = type_registry['mute'] else: - moderation_type = "UNMUTE" + moderation_type = type_registry['unmute'] else: return await Moderation.log( - self.bot, - entry.guild.id, - entry.user.id, - moderation_type, - "USER", - entry.target.id, - None, - duration, - reason, + bot=self.bot, + guild_id=entry.guild.id, + moderator_id=entry.user.id, + moderation_type=moderation_type, + target_type="USER", + target_id=entry.target.id, + role_id=None, + duration=duration, + reason=reason, ) except AttributeError: return