From f32ab6957cdbc3f0a110c08e86f4e59c8e0b2a41 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 20 Jul 2021 18:47:35 -0600 Subject: [PATCH 1/2] Closes #60, shows date/time on warnings. Potential bug: Embed field too large --- jarvis/cogs/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/cogs/admin.py b/jarvis/cogs/admin.py index d2f9b9b..e95a5b5 100644 --- a/jarvis/cogs/admin.py +++ b/jarvis/cogs/admin.py @@ -873,14 +873,14 @@ 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) + total = len(active) if warnings else 0 fields = [ Field(f"{len(active)} Active", "\n".join(active)), Field("Total", total), From dcbcbcf8b6a0564c28996a88d136563f67340d86 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 20 Jul 2021 18:55:58 -0600 Subject: [PATCH 2/2] Change format of warnings list --- jarvis/cogs/admin.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jarvis/cogs/admin.py b/jarvis/cogs/admin.py index e95a5b5..5b1ed64 100644 --- a/jarvis/cogs/admin.py +++ b/jarvis/cogs/admin.py @@ -873,16 +873,21 @@ class AdminCog(commands.Cog): ) 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)) ] if warnings 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 = [ - Field(f"{len(active)} Active", "\n".join(active)), + Field(f"{n_active} Active", "\n".join(active)), Field("Total", total), ] embed = build_embed(