forked from cswimr/SeaCogs
fix(aurora): fixed an error in utils.get_next_case_number
This commit is contained in:
parent
719f02bde7
commit
90e80d1018
1 changed files with 3 additions and 2 deletions
|
@ -102,7 +102,7 @@ async def check_moddable(
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def get_next_case_number(guild_id: str, cursor=None):
|
async def get_next_case_number(guild_id: str, cursor = None) -> int:
|
||||||
"""This function returns the next case number from the MySQL table for a specific guild."""
|
"""This function returns the next case number from the MySQL table for a specific guild."""
|
||||||
from .database import connect
|
from .database import connect
|
||||||
|
|
||||||
|
@ -112,7 +112,8 @@ async def get_next_case_number(guild_id: str, cursor=None):
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
f"SELECT moderation_id FROM `moderation_{guild_id}` ORDER BY moderation_id DESC LIMIT 1"
|
f"SELECT moderation_id FROM `moderation_{guild_id}` ORDER BY moderation_id DESC LIMIT 1"
|
||||||
)
|
)
|
||||||
return cursor.fetchone()[0] + 1
|
result = cursor.fetchone()
|
||||||
|
return (result[0] + 1) if result else 1
|
||||||
|
|
||||||
|
|
||||||
def generate_dict(result):
|
def generate_dict(result):
|
||||||
|
|
Loading…
Reference in a new issue