mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Fixed reminder & broken import
This commit is contained in:
parent
6ddaa6e488
commit
1d0782bdc8
3 changed files with 8 additions and 2 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue