feat(moderation): added timestamps to history embeds
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 54s
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 54s
This commit is contained in:
parent
fc0dc8aefe
commit
1b999f386b
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue