From ac9405a2b5a00e0a25059fa0c82e38fa48444bb5 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Thu, 1 Oct 2020 08:34:32 -0700 Subject: [PATCH] [Chatchart] No negative values How the user got this no one knows, but here you go --- chatchart/chatchart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chatchart/chatchart.py b/chatchart/chatchart.py index 66221e9..566e82c 100644 --- a/chatchart/chatchart.py +++ b/chatchart/chatchart.py @@ -28,8 +28,8 @@ class Chatchart(commands.Cog): def create_chart(self, top, others, channel): plt.clf() - sizes = [x[1] for x in top] - labels = ["{} {:g}%".format(x[0], x[1]) for x in top] + sizes = [x[1] for x in top if x[1] > 0] + labels = ["{} {:g}%".format(x[0], x[1]) for x in top if x[1] > 0] if len(top) >= 20: sizes = sizes + [others] labels = labels + ["Others {:g}%".format(others)]