fix(moderation): fixed broken duration imports
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 50s

This commit is contained in:
Seaswimmer 2023-12-16 20:20:45 -05:00
parent cef337132b
commit 53003efb89
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -1788,11 +1788,13 @@ class Moderation(commands.Cog):
timestamp = round(case['timestamp'] / 1000)
if case['duration']:
if case['duration'] is not None:
try:
duration = timedelta(seconds=round(float(case['duration']) / 1000))
except OverflowError:
continue
else:
duration = timedelta(seconds=0)
if case['resolved']:
resolved = 1