From 15ccd5530a461010543a02d6ff9e60aa94af4241 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 6 May 2024 16:37:52 -0400 Subject: [PATCH] fix(aurora): fixed a few unboundlocalerrors --- aurora/aurora.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 695320b..cacee63 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -20,8 +20,7 @@ from redbot.core import app_commands, commands, data_manager from redbot.core.app_commands import Choice from redbot.core.bot import Red from redbot.core.commands.converter import parse_relativedelta, parse_timedelta -from redbot.core.utils.chat_formatting import (box, error, humanize_list, - humanize_timedelta, warning) +from redbot.core.utils.chat_formatting import box, error, humanize_list, humanize_timedelta, warning from aurora.importers.aurora import ImportAuroraView from aurora.importers.galacticbot import ImportGalacticBotView @@ -32,17 +31,10 @@ from aurora.menus.overrides import Overrides from aurora.models import Change, Moderation from aurora.utilities.config import config, register_config from aurora.utilities.database import connect, create_guild_table -from aurora.utilities.factory import (addrole_embed, case_factory, - changes_factory, evidenceformat_factory, - guild_embed, immune_embed, - message_factory, overrides_embed) - +from aurora.utilities.factory import addrole_embed, case_factory, changes_factory, evidenceformat_factory, guild_embed, immune_embed, message_factory, overrides_embed from aurora.utilities.json import dump from aurora.utilities.logger import logger -from aurora.utilities.utils import (check_moddable, check_permissions, - get_footer_image, log, send_evidenceformat, - timedelta_from_relativedelta) - +from aurora.utilities.utils import check_moddable, check_permissions, get_footer_image, log, send_evidenceformat, timedelta_from_relativedelta class Aurora(commands.Cog): """Aurora is a fully-featured moderation system. @@ -1145,10 +1137,10 @@ class Aurora(commands.Cog): }) moderator = memory_dict[str(mod.moderator_id)] - field_name = f"Case #{case['moderation_id']:,} ({str.title(case['moderation_type'])})" + field_name = f"Case #{mod.id:,} ({str.title(mod.type)})" field_value = f"**Target:** `{target.name}` ({target.id})\n**Moderator:** `{moderator.name}` ({moderator.id})" - if len(case["reason"]) > 125: + if len(mod.reason) > 125: field_value += f"\n**Reason:** `{str(mod.reason)[:125]}...`" else: field_value += f"\n**Reason:** `{str(mod.reason)}`"