fix(aurora): pylint fix + sqlite connection fix

This commit is contained in:
Seaswimmer 2023-12-28 04:45:50 -05:00
parent a402f23001
commit 4226d0b6fe
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -3,7 +3,6 @@
import json
import time
import sqlite3
from os import sep
from datetime import datetime
from discord import Guild
@ -16,7 +15,7 @@ from .utils import generate_dict, get_next_case_number
def connect() -> sqlite3.Connection:
"""Connects to the SQLite database, and returns a connection object."""
try:
connection = sqlite3.connect(database=data_manager.cog_data_path(raw_name='Moderation') + sep + 'moderation.db')
connection = sqlite3.connect(database=data_manager.cog_data_path(raw_name='Aurora') / 'aurora.db')
return connection
except sqlite3.ProgrammingError as e:
@ -103,6 +102,7 @@ async def create_guild_table(guild: Guild):
database.close()
# pylint: disable=dangerous-default-value
async def mysql_log(
guild_id: str,
author_id: str,
@ -118,8 +118,8 @@ async def mysql_log(
resolved_by: str = None,
resolved_reason: str = None,
expired: bool = None,
changes: list = [], # pylint: disable=dangerous-default-value
metadata: dict = {}, # pylint: disable=dangerous-default-value
changes: list = [],
metadata: dict = {},
) -> int:
if not timestamp:
timestamp = int(time.time())