createRepeatedTask(), how?
Any examples on how to create a repeated task? There is nothing in the documentation about it.
7 Replies
@beetle that's exactly what I'm asking. No examples on how to use createRepeatedTask()
I wanted to create a task that repeats every x minutes for a given amount of times, with a delay for the first.
where are you importing this function from?
this.container.tasks.createRepeatedpattern task example: https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks/README.md#pattern-task-example
interval task example: https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks/README.md#interval-task-example
as for the createRepeated function, the only thing i know of is that it takes an array of tasks (type of
ScheduledTaskCreateRepeatedTask)
-# unfortuantely, i don't use the scheduled tasks plugin so unable to help further than what i can see on github and the docsYeah, none of these work for what I want.
I want to call a task with an initial delay of 5min, then run it 6 times with a 10 min interval.
I haven't used the plugin myself, but from what I do know of it, it seems like for your use case you could create a single task for your delay, with a payload of your repeated interval, then create a repeated task when that task runs
You might have to track how many times the repeated task has run yourself and then cancel it after it's ran the number of times you want