fix(moderation): fixed history trying to convert a null value to an integer
Some checks failed
Pylint / Pylint (push) Failing after 1m13s

This commit is contained in:
Seaswimmer 2023-10-06 13:34:11 -04:00
parent 1fd80ff074
commit 07ff047ddb
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -476,8 +476,8 @@ class Moderation(commands.Cog):
field_name = f"Case #{case['moderation_id']} ({str.title(case['moderation_type'])})" field_name = f"Case #{case['moderation_id']} ({str.title(case['moderation_type'])})"
field_value = f"**Target:** `{target_name}` ({target_user['id']})\n**Moderator:** `{moderator_name}` ({moderator_user['id']})\n**Reason:** `{str(case['reason'])[:150]}`" field_value = f"**Target:** `{target_name}` ({target_user['id']})\n**Moderator:** `{moderator_name}` ({moderator_user['id']})\n**Reason:** `{str(case['reason'])[:150]}`"
if case['duration'] != 'NULL' and case['end_timestamp'] != '0': if case['duration'] != 'NULL' and case['end_timestamp'] != '0':
td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case_dict["duration"].split(":"))}) td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case["duration"].split(":"))})
duration_embed = f"{humanize.precisedelta(td)} | <t:{case_dict['end_timestamp']}:R>" if case_dict["expired"] == '0' else f"{humanize.precisedelta(td)} | Expired" duration_embed = f"{humanize.precisedelta(td)} | <t:{case['end_timestamp']}:R>" if case["expired"] == '0' else f"{humanize.precisedelta(td)} | Expired"
field_value = field_value + f"\n**Duration:** {duration_embed}" field_value = field_value + f"\n**Duration:** {duration_embed}"
if case['resolved'] == '1': if case['resolved'] == '1':
field_value = field_value + "\n**Resolved:** True" field_value = field_value + "\n**Resolved:** True"