Skip to content

Scheduler

Type: Bot

Type: Job | null

Gets the number of jobs in the scheduler.

Type: number

Adds a job to the scheduler.

ParameterTypeDescription
jobJobThe job to add.

Returns: void

Get a job.

ParameterTypeDescription
jobIdstringThe ID of the job.

Returns: T | null

ParameterTypeDescription
jobIdstring

Returns: boolean

Whether the scheduler is currently running.

Returns: boolean

Removes a job from the scheduler.

ParameterTypeDescription
jobJobThe job to remove.

Returns: void

Starts the scheduler, executing jobs in order of priority. Jobs with higher priority (larger number) are executed first.

Returns: Promise<void>

Stops the scheduler.

Returns: void