fix(moderation): duration is stringified now
Some checks failed
Pylint / Pylint (push) Failing after 1m13s
Some checks failed
Pylint / Pylint (push) Failing after 1m13s
This commit is contained in:
parent
613a267797
commit
819b36d267
1 changed files with 1 additions and 1 deletions
|
@ -393,7 +393,7 @@ class Moderation(commands.Cog):
|
||||||
embed.description = f"**Type:** {str.title(case['moderation_type'])}\n**Target:** {target_name} ({target.id})\n**Moderator:** {moderator_name} ({moderator.id})\n**Resolved:** {bool(case['resolved'])}\n**Timestamp:** <t:{case['timestamp']}> | <t:{case['timestamp']}:R>"
|
embed.description = f"**Type:** {str.title(case['moderation_type'])}\n**Target:** {target_name} ({target.id})\n**Moderator:** {moderator_name} ({moderator.id})\n**Resolved:** {bool(case['resolved'])}\n**Timestamp:** <t:{case['timestamp']}> | <t:{case['timestamp']}:R>"
|
||||||
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 case["expired"] == '0' else {humanize.precisedelta(td)}
|
duration_embed = f"{humanize.precisedelta(td)} | <t:{case['end_timestamp']}:R>" if case["expired"] == '0' else str(humanize.precisedelta(td))
|
||||||
embed.description = embed.description + f"\n**Duration:** {duration_embed}\n**Expired:** {bool(case['expired'])}"
|
embed.description = embed.description + f"\n**Duration:** {duration_embed}\n**Expired:** {bool(case['expired'])}"
|
||||||
embed.add_field(name='Reason', value=f"```{case['reason']}```", inline=False)
|
embed.add_field(name='Reason', value=f"```{case['reason']}```", inline=False)
|
||||||
if case['resolved'] == 1:
|
if case['resolved'] == 1:
|
||||||
|
|
Loading…
Reference in a new issue