fix(moderation): changed how resolved moderations are determined in history command
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
This commit is contained in:
parent
07ff047ddb
commit
fc5ee4dcc0
1 changed files with 2 additions and 2 deletions
|
@ -475,11 +475,11 @@ class Moderation(commands.Cog):
|
|||
moderator_name = moderator_user['name'] if moderator_user['discriminator'] == "0" else f"{moderator_user['name']}#{moderator_user['discriminator']}"
|
||||
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]}`"
|
||||
if case['duration'] != 'NULL' and case['end_timestamp'] != '0':
|
||||
if case['duration'] != 'NULL':
|
||||
td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case["duration"].split(":"))})
|
||||
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}"
|
||||
if case['resolved'] == '1':
|
||||
if bool(case['resolved']):
|
||||
field_value = field_value + "\n**Resolved:** True"
|
||||
embed.add_field(name=field_name, value=field_value, inline=False)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
|
Loading…
Reference in a new issue