tools.scheduled_prompt module

Cron-based scheduled prompt tools (v3)

Schedule prompts to be executed at specified times or cron intervals. Prompts are executed directly via the bot runner’s message pipeline. Persists prompt metadata in Redis.

Module-level tick_scheduled_prompts and cleanup_expired_prompts are used by background_tasks.py and accept a redis client directly.

tools.scheduled_prompt.set_bot_runner(runner)[source]

Store a reference to the BotRunner for direct prompt execution (called once at startup from main.py).

Return type:

None

Parameters:

runner (Any)

async tools.scheduled_prompt.tick_scheduled_prompts(redis)[source]

Check for due prompts and fire them.

Return type:

None

async tools.scheduled_prompt.cleanup_expired_prompts(redis, *, days_to_keep=30)[source]

Remove old executed/cancelled prompts.

Return type:

str

Parameters:

days_to_keep (int)