feat(moderation): added a changes field to the case embed
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 48s

This commit is contained in:
Seaswimmer 2023-12-15 15:47:29 -05:00
parent 0f16b0eee9
commit c07e3cc095
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -468,7 +468,9 @@ class Moderation(commands.Cog):
if case_dict['duration'] != 'NULL': if case_dict['duration'] != 'NULL':
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_dict["duration"].split(":"))})
duration_embed = f"{humanize.precisedelta(td)} | <t:{case_dict['end_timestamp']}:R>" if bool(case_dict['expired']) is False else str(humanize.precisedelta(td)) duration_embed = f"{humanize.precisedelta(td)} | <t:{case_dict['end_timestamp']}:R>" if bool(case_dict['expired']) is False else str(humanize.precisedelta(td))
embed.description = embed.description + f"\n**Duration:** {duration_embed}\n**Expired:** {bool(case_dict['expired'])}" embed.description += f"\n**Duration:** {duration_embed}\n**Expired:** {bool(case_dict['expired'])}"
embed.description += f"\n**Changes:** {len(case_dict['changes'])}"
embed.add_field(name='Reason', value=f"```{case_dict['reason']}```", inline=False) embed.add_field(name='Reason', value=f"```{case_dict['reason']}```", inline=False)