feat(moderation): added timestamps to history embeds
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 54s

This commit is contained in:
Seaswimmer 2023-12-14 16:50:01 -05:00
parent fc0dc8aefe
commit 1b999f386b
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -925,12 +925,14 @@ class Moderation(commands.Cog):
if case['duration'] != 'NULL': if case['duration'] != 'NULL':
td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case["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['end_timestamp']}:R>" if bool(case['expired']) is False else f"{humanize.precisedelta(td)} | Expired" duration_embed = f"{humanize.precisedelta(td)} | <t:{case['end_timestamp']}:R>" if bool(case['expired']) is False else f"{humanize.precisedelta(td)} | Expired"
field_value = field_value + f"\n**Duration:** {duration_embed}" field_value += f"\n**Duration:** {duration_embed}"
field_value += f"\n**Timestamp:** <t:{case['timestamp']}> | <t:{case['timestamp']}:R>"
if bool(case['resolved']): if bool(case['resolved']):
field_value = field_value + "\n**Resolved:** True" field_value += "\n**Resolved:** True"
embed.add_field(name=field_name, value=field_value, inline=False) embed.add_field(name=field_name, value=field_value, inline=True)
await interaction.followup.send(embed=embed, ephemeral=ephemeral) await interaction.followup.send(embed=embed, ephemeral=ephemeral)