diff --git a/aurora/utilities/database.py b/aurora/utilities/database.py index 762214b..88189dc 100644 --- a/aurora/utilities/database.py +++ b/aurora/utilities/database.py @@ -3,7 +3,7 @@ import json import time import sqlite3 -from datetime import datetime +from datetime import datetime, timedelta from discord import Guild from redbot.core import data_manager @@ -110,7 +110,7 @@ async def mysql_log( target_type: str, target_id: int, role_id: int, - duration, + duration: timedelta, reason: str, database: sqlite3.Connection = None, timestamp: int = None, @@ -127,7 +127,12 @@ async def mysql_log( if duration != "NULL": end_timedelta = datetime.fromtimestamp(timestamp) + duration end_timestamp = int(end_timedelta.timestamp()) - duration = str(duration) + + total_seconds = int(duration.total_seconds()) + hours = total_seconds // 3600 + minutes = (total_seconds % 3600) // 60 + seconds = total_seconds % 60 + duration = f"{hours}:{minutes}:{seconds}" else: end_timestamp = 0