mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Customize les reminder per minor
This commit is contained in:
parent
1ee9900891
commit
04d03fa2cb
5 changed files with 44 additions and 5 deletions
|
|
@ -203,7 +203,7 @@ class Tasks(commands.Cog):
|
|||
continue
|
||||
|
||||
# Create embed once because this can be heavy
|
||||
if "embed" in category:
|
||||
if "embed" in category and category["embed_once"]:
|
||||
embed = category["embed"]()
|
||||
else:
|
||||
embed = None
|
||||
|
|
@ -219,6 +219,13 @@ class Tasks(commands.Cog):
|
|||
if "embed" not in category:
|
||||
await userInstance.send(random.choice(category["messages"]))
|
||||
else:
|
||||
# Embed has to be customized per user
|
||||
if embed is None and "embed_once" in category:
|
||||
# TODO clean this up, there's a better way :)
|
||||
# remind category with a before- method & setup per user
|
||||
args = category["argsf"](self.client, user)
|
||||
embed = category["embed"](*args)
|
||||
|
||||
await userInstance.send(random.choice(category["messages"]), embed=embed)
|
||||
|
||||
with open("files/lastTasks.json", "w") as fp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue