WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
2 changed files with 17 additions and 6 deletions
Showing only changes of commit c69b3cd032 - Show all commits

View file

@ -20,7 +20,8 @@ from redbot.core import app_commands, commands, data_manager
from redbot.core.app_commands import Choice from redbot.core.app_commands import Choice
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.commands.converter import parse_relativedelta, parse_timedelta 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.aurora import ImportAuroraView
from aurora.importers.galacticbot import ImportGalacticBotView from aurora.importers.galacticbot import ImportGalacticBotView
@ -32,10 +33,17 @@ from aurora.models.change import Change
from aurora.models.moderation import Moderation from aurora.models.moderation import Moderation
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 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.json import dump
from aurora.utilities.logger import logger 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): class Aurora(commands.Cog):
"""Aurora is a fully-featured moderation system. """Aurora is a fully-featured moderation system.

View file

@ -2,14 +2,17 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Union from typing import Union
from discord import Color, Embed, Guild, Interaction, InteractionMessage, Member, Role, User from discord import (Color, 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, humanize_timedelta, warning from redbot.core.utils.chat_formatting import (bold, box, error,
humanize_timedelta, warning)
from aurora.models.moderation import Moderation from aurora.models.moderation import Moderation
from aurora.models.partials import PartialUser from aurora.models.partials import PartialUser
from aurora.utilities.config import config from aurora.utilities.config import config
from aurora.utilities.utils import get_bool_emoji, get_next_case_number, get_pagesize_str from aurora.utilities.utils import (get_bool_emoji, get_next_case_number,
get_pagesize_str)
async def message_factory( async def message_factory(