feat(aurora): migrated to aiosqlite
This commit is contained in:
parent
027144f35d
commit
5cbf4e7e47
9 changed files with 127 additions and 116 deletions
|
@ -27,14 +27,10 @@ class ImportAuroraView(ui.View):
|
|||
"Deleting original table...", ephemeral=True
|
||||
)
|
||||
|
||||
database = connect()
|
||||
cursor = database.cursor()
|
||||
|
||||
query = f"DROP TABLE IF EXISTS moderation_{self.ctx.guild.id};"
|
||||
cursor.execute(query)
|
||||
|
||||
cursor.close()
|
||||
database.commit()
|
||||
async with connect() as database:
|
||||
query = f"DROP TABLE IF EXISTS moderation_{self.ctx.guild.id};"
|
||||
database.execute(query)
|
||||
database.commit()
|
||||
|
||||
await interaction.edit_original_response(content="Creating new table...")
|
||||
|
||||
|
@ -96,7 +92,7 @@ class ImportAuroraView(ui.View):
|
|||
duration = None
|
||||
|
||||
try:
|
||||
Moderation.log(
|
||||
await Moderation.log(
|
||||
bot=interaction.client,
|
||||
guild_id=self.ctx.guild.id,
|
||||
moderator_id=case["moderator_id"],
|
||||
|
|
|
@ -26,14 +26,14 @@ class ImportGalacticBotView(ui.View):
|
|||
"Deleting original table...", ephemeral=True
|
||||
)
|
||||
|
||||
database = connect()
|
||||
cursor = database.cursor()
|
||||
database = await connect()
|
||||
cursor = await database.cursor()
|
||||
|
||||
query = f"DROP TABLE IF EXISTS moderation_{self.ctx.guild.id};"
|
||||
cursor.execute(query)
|
||||
await cursor.execute(query)
|
||||
|
||||
cursor.close()
|
||||
database.commit()
|
||||
await cursor.close()
|
||||
await database.commit()
|
||||
|
||||
await interaction.edit_original_response(content="Creating new table...")
|
||||
|
||||
|
@ -124,7 +124,7 @@ class ImportGalacticBotView(ui.View):
|
|||
else:
|
||||
reason = None
|
||||
|
||||
Moderation.log(
|
||||
await Moderation.log(
|
||||
self.ctx.guild.id,
|
||||
case["executor"],
|
||||
case["type"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue