From d7266faad55257fea0555100a657b75b7d701d68 Mon Sep 17 00:00:00 2001 From: AnInternetTroll Date: Sun, 4 Apr 2021 15:11:05 +0200 Subject: Minor changes --- cogs/utils.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'cogs') diff --git a/cogs/utils.py b/cogs/utils.py index ed43b7c..e19ad11 100755 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -529,16 +529,28 @@ class Utils(commands.Cog): # Detect people who didn't maintain their streak. for user in fair: tz = fair[user]["timezone"] - currentdate = datetime.datetime.now(timezone(tz)).date() + try: + currentdate = datetime.datetime.now(timezone(tz)).date() + except: + # Ocean put in a test timezone and it messes with stuff + continue if fair[user]["date"] != str(currentdate) and fair[user]["date"] != str( currentdate - timedelta(1) ): fair[user]["streak"] = 1 fair[user]["date"] = str(currentdate) - await ctx.send( - self.bot.get_user(int(user)).mention - + ": You lost your streak! <:sad:716629485449117708>" - ) + try: + # It seems like people don't like spam pings + + # await ctx.send( + # self.bot.get_user(int(user)).mention + # + ": You lost your streak! <:sad:716629485449117708>" + # ) + + pass + except: + # User left the server so the bot can't find them + continue with open("fair.json", "w") as f: json.dump(fair, f, indent=4) -- cgit v1.2.3