fix(aurora): ruff fixes

This commit is contained in:
Seaswimmer 2024-02-14 10:39:26 -05:00
parent 516e4539e8
commit 9c293750cb
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063
2 changed files with 17 additions and 40 deletions

View file

@ -28,28 +28,17 @@ from aurora.menus.guild import Guild
from aurora.menus.immune import Immune from aurora.menus.immune import Immune
from aurora.menus.overrides import Overrides from aurora.menus.overrides import Overrides
from aurora.utilities.config import config, register_config from aurora.utilities.config import config, register_config
from aurora.utilities.database import connect, create_guild_table, fetch_case, mysql_log from aurora.utilities.database import (connect, create_guild_table, fetch_case,
from aurora.utilities.factory import ( mysql_log)
addrole_embed, from aurora.utilities.factory import (addrole_embed, case_factory,
case_factory, changes_factory, evidenceformat_factory,
changes_factory, guild_embed, immune_embed,
evidenceformat_factory, message_factory, overrides_embed)
guild_embed,
immune_embed,
message_factory,
overrides_embed,
)
from aurora.utilities.logger import logger from aurora.utilities.logger import logger
from aurora.utilities.utils import ( from aurora.utilities.utils import (check_moddable, check_permissions,
check_moddable, convert_timedelta_to_str,
check_permissions, fetch_channel_dict, fetch_user_dict,
convert_timedelta_to_str, generate_dict, log, send_evidenceformat)
fetch_channel_dict,
fetch_user_dict,
generate_dict,
log,
send_evidenceformat,
)
class Aurora(commands.Cog): class Aurora(commands.Cog):
@ -344,7 +333,7 @@ class Aurora(commands.Cog):
else: else:
parsed_time = "NULL" parsed_time = "NULL"
if not role.id in addrole_whitelist: if role.id not in addrole_whitelist:
await interaction.response.send_message( await interaction.response.send_message(
content=error("That role isn't whitelisted!"), ephemeral=True content=error("That role isn't whitelisted!"), ephemeral=True
) )

View file

@ -4,27 +4,15 @@ from datetime import datetime, timedelta
from typing import Union from typing import Union
import humanize import humanize
from discord import ( from discord import (Color, Embed, Guild, Interaction, InteractionMessage,
Color, Member, Role, User)
Embed,
Guild,
Interaction,
InteractionMessage,
Member,
Role,
User,
)
from redbot.core import commands from redbot.core import commands
from redbot.core.utils.chat_formatting import bold, box, error, warning from redbot.core.utils.chat_formatting import bold, box, error, warning
from aurora.utilities.config import config from aurora.utilities.config import config
from aurora.utilities.utils import ( from aurora.utilities.utils import (fetch_channel_dict, fetch_user_dict,
fetch_channel_dict, get_bool_emoji, get_next_case_number,
fetch_user_dict, get_pagesize_str)
get_bool_emoji,
get_next_case_number,
get_pagesize_str,
)
async def message_factory( async def message_factory(
@ -53,7 +41,7 @@ async def message_factory(
Returns: Returns:
embed: The message embed. embed: The message embed.
""" """
if response is not None and not moderation_type in [ if response is not None and moderation_type not in [
"kicked", "kicked",
"banned", "banned",
"tempbanned", "tempbanned",