aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2021-04-04 13:11:05 +0000
committerAnInternetTroll <lucafulger@gmail.com>2021-04-04 13:11:05 +0000
commitd7266faad55257fea0555100a657b75b7d701d68 (patch)
tree24909e72c89be785ec2dd9471339659d4bdc7467 /cogs
parent6ae27f8b7f395b1ff4acab43214619d54736a274 (diff)
downloadsteve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar.gz
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar.bz2
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar.lz
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar.xz
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.tar.zst
steve-bot-d7266faad55257fea0555100a657b75b7d701d68.zip
Minor changes
Diffstat (limited to 'cogs')
-rwxr-xr-xcogs/utils.py22
1 files changed, 17 insertions, 5 deletions
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)