feat(aurora): cleaned up the codebase and fixed a whole bunch of bugs
This commit is contained in:
parent
53b67e1c95
commit
d7ca5cab46
5 changed files with 148 additions and 343 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue