feat(aurora): cleaned up the codebase and fixed a whole bunch of bugs
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 42s

This commit is contained in:
SeaswimmerTheFsh 2024-05-06 16:34:08 -04:00
parent 53b67e1c95
commit d7ca5cab46
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F
5 changed files with 148 additions and 343 deletions

View file

@ -7,7 +7,8 @@ from discord import ButtonStyle, Interaction, Message, ui
from redbot.core import commands
from redbot.core.utils.chat_formatting import box, warning
from ..utilities.database import connect, create_guild_table, mysql_log
from aurora.models import Change, Moderation
from aurora.utilities.database import connect, create_guild_table
class ImportGalacticBotView(ui.View):
@ -99,37 +100,37 @@ class ImportGalacticBotView(ui.View):
if resolved_timestamp is None:
resolved_timestamp = timestamp
changes = [
{
Change.from_dict({
"type": "ORIGINAL",
"reason": case["reason"],
"user_id": case["executor"],
"timestamp": timestamp,
},
{
}),
Change.from_dict({
"type": "RESOLVE",
"reason": resolved_reason,
"user_id": resolved_by,
"timestamp": resolved_timestamp,
},
}),
]
else:
resolved = 0
resolved = None
resolved_by = None
resolved_reason = None
changes = []
changes = None
if case["reason"] and case["reason"] != "N/A":
reason = case["reason"]
else:
reason = None
await mysql_log(
Moderation.log(
self.ctx.guild.id,
case["executor"],
case["type"],
case["targetType"],
case["target"],
0,
None,
duration,
reason,
timestamp=timestamp,