fix(moderation): case now uses the expired value to determine if a duration'd moderation has expired
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
This commit is contained in:
parent
11da49202d
commit
db4826e232
1 changed files with 1 additions and 2 deletions
|
@ -388,9 +388,8 @@ class Moderation(commands.Cog):
|
|||
embed = discord.Embed(title=f"📕 Case #{case['moderation_id']}", color=await self.bot.get_embed_color(None))
|
||||
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':
|
||||
expired = True if case["end_timestamp"] <= time.time() or case['resolved'] == 1 else False
|
||||
td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case["duration"].split(":"))})
|
||||
embed.description = embed.description + f"\n**Duration:** {humanize.precisedelta(td)}\n**Expired:** {expired}"
|
||||
embed.description = embed.description + f"\n**Duration:** {humanize.precisedelta(td)}\n**Expired:** {case['expired']}"
|
||||
embed.add_field(name='Reason', value=f"```{case['reason']}```", inline=False)
|
||||
if case['resolved'] == 1:
|
||||
embed.add_field(name='Resolve Reason', value=f"```{case['resolve_reason']}```", inline=False)
|
||||
|
|
Loading…
Reference in a new issue