From 912409ec3e5e90287439be9b4a7001bf672f63cb Mon Sep 17 00:00:00 2001 From: Conatum Date: Mon, 13 Sep 2021 09:13:35 +0300 Subject: [PATCH] (Leaderboards): Filter out `0` entries. --- bot/modules/economy/cointop_cmd.py | 2 +- bot/modules/study/top_cmd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/modules/economy/cointop_cmd.py b/bot/modules/economy/cointop_cmd.py index a7d220c4..fbf45c71 100644 --- a/bot/modules/economy/cointop_cmd.py +++ b/bot/modules/economy/cointop_cmd.py @@ -46,7 +46,7 @@ async def cmd_topcoin(ctx): guildid=ctx.guild.id, userid=data.NOT([m.id for m in ctx.guild_settings.unranked_roles.members]), select_columns=('userid', 'coins'), - _extra="ORDER BY coins DESC " + ("LIMIT 100" if top100 else "") + _extra="AND coins > 0 ORDER BY coins DESC " + ("LIMIT 100" if top100 else "") ) # Quit early if the leaderboard is empty diff --git a/bot/modules/study/top_cmd.py b/bot/modules/study/top_cmd.py index 6fc138e2..bea0cca7 100644 --- a/bot/modules/study/top_cmd.py +++ b/bot/modules/study/top_cmd.py @@ -46,7 +46,7 @@ async def cmd_top(ctx): guildid=ctx.guild.id, userid=data.NOT([m.id for m in ctx.guild_settings.unranked_roles.members]), select_columns=('userid', 'tracked_time'), - _extra="ORDER BY tracked_time DESC " + ("LIMIT 100" if top100 else "") + _extra="AND tracked_time > 0 ORDER BY tracked_time DESC " + ("LIMIT 100" if top100 else "") ) # Quit early if the leaderboard is empty