Merge branch 'bugfix-60' into 'main'
Warnings List Enhancement Closes #60 See merge request stark-industries/j.a.r.v.i.s.!15
This commit is contained in:
commit
a16411ea83
1 changed files with 8 additions and 3 deletions
|
@ -873,16 +873,21 @@ class AdminCog(commands.Cog):
|
|||
)
|
||||
active = (
|
||||
[
|
||||
y["reason"]
|
||||
f'`{y["time"].strftime("%Y-%m-%d %H:%M:%S")}` - {y["reason"]}'
|
||||
for y in list(filter(lambda x: x["active"], warnings))
|
||||
]
|
||||
if warnings
|
||||
else ["None"]
|
||||
)
|
||||
|
||||
total = len(warnings)
|
||||
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 = [
|
||||
Field(f"{len(active)} Active", "\n".join(active)),
|
||||
Field(f"{n_active} Active", "\n".join(active)),
|
||||
Field("Total", total),
|
||||
]
|
||||
embed = build_embed(
|
||||
|
|
Loading…
Add table
Reference in a new issue