fix(aurora): fixed durations, again
Some checks failed
Pylint / Pylint (3.11) (push) Failing after 43s

This commit is contained in:
Seaswimmer 2023-12-28 05:01:08 -05:00
parent e62bd62e29
commit 5a53e3327b
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -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