Change format of warnings list

This commit is contained in:
Zeva Rose 2021-07-20 18:55:58 -06:00
parent f32ab6957c
commit dcbcbcf8b6

View file

@ -873,16 +873,21 @@ class AdminCog(commands.Cog):
) )
active = ( active = (
[ [
f'[{y["time"].strftime("%Y-%m-%d %H:%M:%S")}] {y["reason"]}' f'`{y["time"].strftime("%Y-%m-%d %H:%M:%S")}` - {y["reason"]}'
for y in list(filter(lambda x: x["active"], warnings)) for y in list(filter(lambda x: x["active"], warnings))
] ]
if warnings if warnings
else ["None"] else ["None"]
) )
total = len(active) if warnings else 0 n_active = len(active)
if len(active) > 10:
active = active[:10]
active.append("\n>10 active, results truncated")
total = len(warnings) if warnings else 0
fields = [ fields = [
Field(f"{len(active)} Active", "\n".join(active)), Field(f"{n_active} Active", "\n".join(active)),
Field("Total", total), Field("Total", total),
] ]
embed = build_embed( embed = build_embed(