Scheduler Package

# Submodules section with toctree removed as automodule below will cover them. # ———- # .. toctree:: # :maxdepth: 1 # # scheduler.tasks

class scheduler.tasks.Scheduler(storage, llm, event_loop=None)[исходный код]

Базовые классы: object

Manages scheduled tasks for users with multi-goal support.

Uses APScheduler with an AsyncIOScheduler to run jobs asynchronously. Works directly with storage and llm instances for multi-goal functionality.

Параметры:

event_loop (AbstractEventLoop | None)

__init__(storage, llm, event_loop=None)[исходный код]

Initializes the Scheduler with storage and llm instances.

Параметры:
  • storage – AsyncStorageInterface implementation

  • llm – AsyncLLMInterface implementation

  • event_loop (AbstractEventLoop | None) – Optional event loop to use. If None, will get the current running loop when needed.

add_user_jobs(bot, user_id)[исходный код]

Adds all standard periodic jobs for a given user.

This includes: - Morning task reminder (_send_today_tasks). - Evening check-in reminder (_send_evening_reminder). - Periodic motivational message (_send_motivation).

Existing jobs with the same ID for the user will be replaced.

Параметры:
start()[исходный код]

Starts the APScheduler if it’s not already running.