Fixed reminder & broken import

This commit is contained in:
Stijn De Clercq 2021-08-10 12:02:39 +02:00
parent 6ddaa6e488
commit 1d0782bdc8
3 changed files with 8 additions and 2 deletions

View file

@ -202,6 +202,12 @@ class Tasks(commands.Cog):
if (not category["weekends"]) and weekday > 4:
continue
# Create embed once because this can be heavy
if "embed" in category:
embed = category["embed"]()
else:
embed = None
for user in category["users"]:
userInstance = self.client.get_user(user)
@ -213,7 +219,7 @@ class Tasks(commands.Cog):
if "embed" not in category:
await userInstance.send(random.choice(category["messages"]))
else:
await userInstance.send(random.choice(category["messages"]), embed=category["embed"])
await userInstance.send(random.choice(category["messages"]), embed=embed)
with open("files/lastTasks.json", "w") as fp:
lastTasks["remind"] = round(time.time())