Skip to content

Multiple instance of a @tasks.loop #6406

Answered by Rapptz
Marc-AntoineGelinas asked this question in Q&A
Discussion options

You must be logged in to vote

The issue you linked is a different matter -- that's storing multiple instances of objects and making them not point to the same underlying task object. This was a bug and was fixed. The design of the task extension however does not allow multiple tasks per object, which is what you're trying to do here.

If you want to do some sort of scheduler you'll have to refactor the system so it works with a single task. That's not inherently difficult, though it depends on how you're storing this information in the first place. Your example code does not have any underlying storage, so as a result it doesn't really work once you restart the bot anyway, something to keep in mind for later.

That bein…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Marc-AntoineGelinas
Comment options

@mystique09
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants