telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Class Job<Data>

    Represents an individual scheduled task managed by JobQueue.

    Type Parameters

    • Data = unknown

      Type of custom data payload attached to this job.

    Index
    • Constructs a new Job instance.

      Type Parameters

      • Data = unknown

        Type of custom data payload attached to this job.

      Parameters

      • options: {
            callback: JobCallback<Data>;
            chat_id?: string | number;
            data?: Data;
            intervalMs?: number;
            jobQueue: JobQueue;
            name: string;
            nextRunMs: number;
            rrule?: RRule;
            rruleOptions?: string | RRuleOptions;
            timezone?: string;
            user_id?: number;
        }

      Returns Job<Data>

    callback: JobCallback<Data>

    The callback function to execute.

    chat_id?: string | number

    Optional Telegram chat ID associated with this job.

    data?: Data

    Optional custom data payload passed to the job callback.

    enabled: boolean = true

    Whether the job is enabled for execution. When false, the timer fires but the callback is skipped.

    intervalMs?: number

    Interval in milliseconds between runs (for repeating jobs).

    name: string

    The unique name of the scheduled job.

    next_t: number

    Epoch timestamp in milliseconds when the job is next scheduled to execute.

    removed: boolean = false

    Whether the job has been removed or canceled.

    rrule?: RRule

    Optional RFC 5545 recurrence rule engine instance.

    rruleOptions?: string | RRuleOptions

    Optional RFC 5545 rrule string or options for persistence recovery.

    timezone?: string

    Optional timezone for persistence recovery.

    user_id?: number

    Optional Telegram user ID associated with this job.

    • Internal

      Internal scheduler that handles long delays > 24.8 days safely by chunking.

      Returns void

    • Permanently cancels and removes this job from the JobQueue.

      Returns void