fix(aurora): update the autologger method to use the new type registry
All checks were successful
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 54s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s

This commit is contained in:
Seaswimmer 2024-08-23 14:43:43 -04:00
parent 6560f98aef
commit 5459392d7e
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -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