From 8388cfa8405d9d0af0a22783e53fb71f737f75bc Mon Sep 17 00:00:00 2001 From: phxntxm Date: Tue, 9 Oct 2018 09:38:39 -0500 Subject: [PATCH] Correct couple small errors caused by database format change --- cogs/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/stats.py b/cogs/stats.py index effae8b..f6e4f34 100644 --- a/cogs/stats.py +++ b/cogs/stats.py @@ -215,7 +215,7 @@ class Stats: stats = { command: data['server_usage'].get(str(server.id)) for command, data in command_stats.items() - if data['server_usage'].get(str(server.id), 0) > 0 + if data.get("server_usage", {}).get(str(server.id), 0) > 0 } sorted_stats = sorted(stats.items(), key=lambda x: x[1], reverse=True) try: @@ -272,7 +272,7 @@ class Stats: await ctx.message.channel.trigger_typing() boops = self.bot.db.load('boops', key=ctx.message.author.id) - if boops is None: + if not boops: await ctx.send("You have not booped anyone {} Why the heck not...?".format(ctx.message.author.mention)) return