forked from cswimr/SeaCogs
fix(aurora): pylint fix + sqlite connection fix
This commit is contained in:
parent
a402f23001
commit
4226d0b6fe
1 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,6 @@
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from os import sep
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from discord import Guild
|
from discord import Guild
|
||||||
|
@ -16,7 +15,7 @@ from .utils import generate_dict, get_next_case_number
|
||||||
def connect() -> sqlite3.Connection:
|
def connect() -> sqlite3.Connection:
|
||||||
"""Connects to the SQLite database, and returns a connection object."""
|
"""Connects to the SQLite database, and returns a connection object."""
|
||||||
try:
|
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
|
return connection
|
||||||
|
|
||||||
except sqlite3.ProgrammingError as e:
|
except sqlite3.ProgrammingError as e:
|
||||||
|
@ -103,6 +102,7 @@ async def create_guild_table(guild: Guild):
|
||||||
database.close()
|
database.close()
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=dangerous-default-value
|
||||||
async def mysql_log(
|
async def mysql_log(
|
||||||
guild_id: str,
|
guild_id: str,
|
||||||
author_id: str,
|
author_id: str,
|
||||||
|
@ -118,8 +118,8 @@ async def mysql_log(
|
||||||
resolved_by: str = None,
|
resolved_by: str = None,
|
||||||
resolved_reason: str = None,
|
resolved_reason: str = None,
|
||||||
expired: bool = None,
|
expired: bool = None,
|
||||||
changes: list = [], # pylint: disable=dangerous-default-value
|
changes: list = [],
|
||||||
metadata: dict = {}, # pylint: disable=dangerous-default-value
|
metadata: dict = {},
|
||||||
) -> int:
|
) -> int:
|
||||||
if not timestamp:
|
if not timestamp:
|
||||||
timestamp = int(time.time())
|
timestamp = int(time.time())
|
||||||
|
|
Loading…
Reference in a new issue